views:

95

answers:

0

Hi,

I followed this article and it works great except when paging or sorting the HeaderCheckBox is still checked. How and where should this be unchecked? I think it would be best to uncheck it in the control itself, but I am not having any luck even getting a reference to it using this code:

protected override void OnSorted(EventArgs e)
        {
             base.OnSorted(e);
             if (AutoGenerateCheckBoxColumn)
             {

                 CheckBox cb = (CheckBox) HeaderRow.FindControl(String.Format(HeaderCheckBoxId, ClientID));
                 if(cb != null)
                 {
                    cb.Checked = false;
                 }
             }
        }

Thanks

I am stumped even changing the HeaderRow Cell Text doesn't work. Here is line from the original that is the HeaderRow Cell Text: private const string CheckBoxColumHeaderTemplate = "<input type='checkbox' hidefocus='true' id='{0}' name='{0}' {1} onclick='CheckAll(this)'>";