Link to home
Start Free TrialLog in
Avatar of ljcor
ljcorFlag for United States of America

asked on

VB 2008 - How to Select rows in a DataGridView

How do I select a row, or several rows (if multi-select) in a DataGridView?
ASKER CERTIFIED SOLUTION
Avatar of JackOfPH
JackOfPH
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ljcor

ASKER

Yes, that is exactly what I wanted to do.   Thanks again.  Today I remember where you live!!  Italy?
Just kidding.  I do remember.
Avatar of ljcor

ASKER

Perhaps you can add to this answer just so I know:  How can I select ALL rows in the grid?

For each row in MyDataGridView  (or something like that?)

Next

???
Here: Sorry for the long response, I went home early yesterday... here is the code you want to do...


For each row as DatagridviewRow in MyDatagridview.rows
 
row.Selected = true
 
Next

Open in new window

Avatar of ljcor

ASKER

I can always wait for a right answer.  Thanks Jack.