Thursday, February 23, 2012

Radio Button

function CheckAll(val)
{
var GridView = document.getElementById('<%=grdPaymentTransaction.ClientID%>');
var checkbox1 = document.getElementById("<%=grdPaymentTransaction.ClientID%>_chkAll");
if (GridView == null) {
alert("Invalid Data");
return false;
}
for (var i = 1; i < GridView.rows.length; i++) {
cell = GridView.rows[i].cells[9];
for (j = 0; j < cell.childNodes.length; j++) {
//if childNode type is CheckBox
if (cell.childNodes[j].type == "checkbox") {
//assign the status of the Select All checkbox to the cell checkbox within the grid
cell.childNodes[j].checked = checkbox1.checked;
}
}
}
return false;
}

No comments:

Post a Comment