Results 1 to 2 of 2

Thread: [RESOLVED] Not getting hit on CheckBox

  1. #1

    Thread Starter
    Fanatic Member snufse's Avatar
    Join Date
    Jul 2004
    Location
    Jupiter, FL
    Posts
    912

    Resolved [RESOLVED] Not getting hit on CheckBox

    Have a GridView with 6 rows filled, CheckBox is the 1st Column. I never get the CheckBox.Checked = True and cannot figure out why:

    Here is the code:

    Code:
    <asp:TemplateField HeaderText="Select">
               <ItemTemplate>
                <asp:CheckBox ID="RowCheckBox" runat="server" />
               </ItemTemplate>
             </asp:TemplateField>
    
    
           For Each myGridViewRow As GridViewRow In GridView1.Rows
                Dim myCheckBox As CheckBox = CType(myGridViewRow.FindControl("RowCheckBox"), CheckBox)
                If myCheckBox.Checked Then
                    mySelection = Trim(myGridViewRow.Cells(1).Text.ToString)
                    If mySelection = "abc" Then
                        ' do something
                    End If
                    If mySelection = "xyz" Then
                        'do something
                    End If
                End If
            Next

  2. #2

    Thread Starter
    Fanatic Member snufse's Avatar
    Join Date
    Jul 2004
    Location
    Jupiter, FL
    Posts
    912

    Re: Not getting hit on CheckBox

    Oooops, found the answer in the link below. Sorry.

    http://www.vbforums.com/showthread.php?t=672558

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width