i am trying to access CheckBox in headertemplate of datagrid, soon after binding data to the grid in the pageindexchanged event.
i get a NullReferenceException when i do that. Could not find the reason. i have already done this accessing of header control elsewhere in my application, but have not had any problem before. Is it any thing to do with the pageindexchanged event.
i access the header control using
System.Web.UI.Control header = _kdmGeneratorGrid.Controls[0].Controls[0];
((
CheckBox)header.FindControl("_selectAllChkBx")).Checked = Convert.ToBoolean(_isAllSelected.Value);
i have done the same in the _selectAllChkBx onCheckedChange Event.
Please help.