Checkbox in Datagrid doesn't fire event

Discussion in 'ASP .Net Datagrid Control' started by Paul D. Fox, Apr 28, 2005.

  1. Paul D. Fox

    Paul D. Fox Guest

    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
     
    Paul D. Fox, Apr 28, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    15,225
  2. Replies:
    4
    Views:
    535
  3. Datagrid PageIndexChanged event doesn't fire

    , Jul 16, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    330
    Teemu Keiski
    Jul 18, 2006
  4. Ravik Tupja

    Datagrid Paging Event Doesn't Fire

    Ravik Tupja, Jun 9, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    253
    Kilic Beg
    Jun 10, 2004
  5. Andy Fish

    load event doesn't fire unless init event is present

    Andy Fish, Jun 28, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    262
    Jonathan Mast
    Jul 7, 2005
Loading...

Share This Page