Use vb.net grid control with ability to check rows and loop through

Hi everyone,  I want to use the grid control in vb.net.  It will be bound to a dataset.  I need a way to click on multiple rows perhaps selecting a check box.  

When a user clicks a button on the form, I will loop through the selected rows and execute some code.

Can anyone help!
jwebster77Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CodeCruiserConnect With a Mentor Commented:
Its a simple loop

For i As Integer = 0 to grid.SelectedRows.Count-1
    Msgbox grid.SelectedRows(i).Cells(0).Value
Next
0
 
CodeCruiserConnect With a Mentor Commented:
Set the MultiSelect property of grid to true, then use CTRL or SHIFT keys and click to select multiple rows. On button click, loop through the SelectedRows property of the grid.
0
 
jwebster77Author Commented:
Do you have any code example for looping?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.