If you are binding your GridView using a DataTable , do this before setting the GridView DataSource .
dataTable.Columns.Add("Select", Type.GetType("System.Boolean")); DemoGrid.DataSource = dataTable; DemoGrid.DataBind(); foreach (GridViewRow row in DemoGrid.Rows) { //check box is the first control on the last cell. CheckBox check = row.Cells[row.Cells.Count - 1].Controls[0] as CheckBox; check.Enabled = true; }
Regarding the unrelated side, note that your asp:GridView actually auto-generated.
source share