Hi Chriz,
Chriz says:
protected
void
gv_RowEditing(
object
sender, GridViewEditEventArgs e)
{
int
index = Convert.ToInt32(e.NewEditIndex);
Label result = (Label)gv.Rows[index].FindControl(
"lblResultAuto"
);
gv.EditIndex = e.NewEditIndex;
if
(result.Text ==
"N/A"
)
{
CheckBox cbYes = (CheckBox)gvChecks.Rows[index].FindControl(
"cbResultManualYes"
);
cbYes.Enabled =
true
;
CheckBox cbNo = (CheckBox)gvChecks.Rows[index].FindControl(
"cbResultManualno"
);
cbNo.Enabled =
true
;
}
bindChecks();
}
Replace above code with below.
C#
protected void gv_RowEditing(object sender, GridViewEditEventArgs e)
{
int index = Convert.ToInt32(e.NewEditIndex);
Label result = (Label)gv.Rows[index].FindControl("lblResultAuto");
gv.EditIndex = e.NewEditIndex;
bindChecks();
if (result.Text == "N/A")
{
CheckBox cbYes = (CheckBox)gv.Rows[index].FindControl("cbResultManualYes");
cbYes.Enabled = true;
CheckBox cbNo = (CheckBox)gv.Rows[index].FindControl("cbResultManualΝο");
cbNo.Enabled = true;
}
}