P
Paul D. Fox
I've added a Checkbox control to a Datagrid and would like to Enable/Disable a button based on whether the checkbox is checked. However, I'm trying to use the "OnCheckChanged" event which doesn't seem to fire. Any ideas as to how to get this to work?
<HeaderTemplate>
<asp:CheckBox id="CheckAll" OnCheckedChanged="SelectedCheckBox_OnCheckedChanged" AutoPostBack=True runat="server" />
</HeaderTemplate>
Code Behind:
Protected Sub SelectedCheckBox_OnCheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim ck1 As CheckBox = CType(sender, CheckBox)
Dim fChecked As Boolean = ck1.Checked
If fChecked Then
btnCTSSignTimesheet.Enabled = True
Else
btnCTSSignTimesheet.Enabled = False
End If
End Sub
<HeaderTemplate>
<asp:CheckBox id="CheckAll" OnCheckedChanged="SelectedCheckBox_OnCheckedChanged" AutoPostBack=True runat="server" />
</HeaderTemplate>
Code Behind:
Protected Sub SelectedCheckBox_OnCheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim ck1 As CheckBox = CType(sender, CheckBox)
Dim fChecked As Boolean = ck1.Checked
If fChecked Then
btnCTSSignTimesheet.Enabled = True
Else
btnCTSSignTimesheet.Enabled = False
End If
End Sub