Checkbox in Datagrid doesn't fire event

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top