To use this function common to Asp.Net
Programmers who uses this requirement.
Steps to Change in this Function:
- Change the GridView ID.
- Change the Header Check box ID.
- Change the all rows having Check box ID
also.
Function
CheckUncheckAllCheckBoxAsNeeded()
{
var
totalCheckboxes = $("#gv1 input[id*='chckAll']:checkbox").size();
var
checkedCheckboxes = $("#gv1 input[id*='chckAll']:checkbox:checked").size();
if
(totalCheckboxes == checkedCheckboxes)
{
$("#gv1
input[id*='chckbxOneByOne']:checkbox").attr('checked', true);
}
else
{
$("#gv1
input[id*='chckbxOneByOne']:checkbox").attr('checked', false);
}
}
Hope this will be helpful to everyone :-)