
In this GridView, I want to disable all the CheckBox in the GridView during the View Mode.
I can disable the GridView Row cells like
foreach (GridViewRow GVR in gvPODetails.Rows)
{
GVR.Cells[1].Enabled =
GVR.Cells[11].Enabled = false;
}
But I dont know how to disable the checkbox in the HeaderTemplate of the Template Field. How to do this?
Recipe:
OnRowDataBoundon your GridViewe.Row.RowType == DataControlRowType.Headerand get a reference to your checkbox control usinge.Row.FindControl(checkBoxID)Enabledproperty toFalse