I have a GridView with two CheckBoxField columns. They both have ReadOnly property set to false, but html code generated for them has attribute disabled=\"disabled\". So the
PhilPursglove solution works for me (even in a nested grivview). Thank you!
My full code (modified to get also the grivview using the control tree, because i can't access the netest gridview directly because of dynamic creation):
protected void Cb_IsApprovedByManagement_CheckChanged(object sender, EventArgs e)
{
CheckBox cb = (CheckBox)sender;
// find the row we clicked the checkbox in by walking up the control tree
GridViewRow selectedRow = (GridViewRow)cb.Parent.Parent;
GridView gridView = (GridView)selectedRow.Parent.Parent;
// look up the DataKeys array
int QuestionID_Current = (int)gridView.DataKeys[selectedRow.DataItemIndex].Value;
// change value
QuestionManager.ToggleActivity(QuestionManager.GetQuestion(QuestionID_Current));