I'd like to disable all elements within a <tr>
element when a checkbox inside it is checked. My code is as follows:
<tr>
<td style="width:25px" id="td_CheckBoxClickable">
<asp:CheckBox runat="server" ClientIDMode="Static" ID="CheckBox_EnableRow" OnCheckedChanged="CheckBox_EnableRow_CheckedChanged" />
</td>
<td>
<asp:TextBox runat="server" ID="textBox_Count" />
</td>
<td>
<asp:TextBox runat="server" ID="textBox_Value" />
</td>
</tr>
and currently the CheckBox_EnableRow_CheckedChanged
event is empty.
I was thinking it would be possible to look at the parent of the parent of the checkbox like this:
protected void CheckBox_EnableRow_CheckedChanged(object sender, EventArgs e) {
TableRow row = (TableRow)((CheckBox)sender).Parent.Parent;
row.Enabled = false;
}
but that doesn't seem to work.