Hi
You also do this finding the header template and based on the status of the header template checkbox you can update the other status in the item template checkbox.
protected void cbxHdrPresent_OnCheckedChanged(object sender, EventArgs e)
{
int chkCount = 0;
CheckBox chkHead = (CheckBox)gvBrowse.HeaderRow.FindControl("cbxHdrPresent");
if (chkHead.Checked)
{
for (int i = 0; i < gvBrowse.Rows.Count; i++)
{
CheckBox chk = (CheckBox)gvBrowse.Rows[i].FindControl("cbxItmPresent");
chk.Checked = true;
chkCount++;
}
}
else
{
for (int i = 0; i < gvBrowse.Rows.Count; i++)
{
CheckBox chk = (CheckBox)gvBrowse.Rows[i].FindControl("cbxItmPresent");
chk.Checked = false;
}
}
if (chkCount > 0)
{
}
else
{
}
}