Use the following code for your reference, it will help you solve your problem.
function SelectAll(id) {
var grid = document.getElementById("<%= this.myGridView.ClientID %>");
var cell;
if (grid.rows.length > 0) {
for (i = 1; i < grid.rows.length; i++) {
cell = grid.rows[i].cells[0];
for (j = 0; j < cell.childNodes.length; j++) {
if (cell.childNodes[j].type == "checkbox") {
if (!cell.childNodes[j].checked) {
alert("Please check in serial order");
}
}
}
}
}
}
Thanks and Regards
Amit Dutta