Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 607
  • Last Modified:

Selecting Multiple GridView Rows

I have a ASP.NET GridView Control that displays a user record.  I added a template colume in the GridView and within that template placed a checkbox.

I want users to be able to select multiple users from my gridview by checking the checkboxes that I put in the template field by their name.  When the user clicks and add user button I need that event handler to be albe to go to the gridview and see what items are selected based on my checkbox.

Is there any tutorial, code, or something out there to show me how to do this.  I can't find any in books or on the net now.
0
hoyaabanks
Asked:
hoyaabanks
1 Solution
 
jeebukarthikeyanCommented:
0
 
davehunt00Commented:
You can do something like this:

        Dim gr As GridViewRow
        For Each gr In gvMyGrid.Rows
            Dim cbox As CheckBox = gr.FindControl("Checkbox1")   'whatever you named it
            If (cbox.Checked = True) Then
                  do something
            End If
        Next

hth
davehunt00
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now