Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB 2008  - How to Select rows in a DataGridView

Posted on 2009-07-09
6
Medium Priority
?
264 Views
Last Modified: 2012-05-07
How do I select a row, or several rows (if multi-select) in a DataGridView?
0
Comment
Question by:ljcor
  • 3
  • 3
6 Comments
 
LVL 15

Accepted Solution

by:
JackOfPH earned 2000 total points
ID: 24811891
What do you mean? Select? Highlight multiple rows?


Try this, The following code will select the first and third row in the datagridview

Datagridview1.Rows(0).Selected = True  
Datagridview1.Rows(2).Selected = True
0
 

Author Closing Comment

by:ljcor
ID: 31601493
Yes, that is exactly what I wanted to do.   Thanks again.  Today I remember where you live!!  Italy?
Just kidding.  I do remember.
0
 
LVL 15

Expert Comment

by:JackOfPH
ID: 24811915
:)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:ljcor
ID: 24811960
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

???
0
 
LVL 15

Expert Comment

by:JackOfPH
ID: 24819468
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

0
 

Author Comment

by:ljcor
ID: 24820119
I can always wait for a right answer.  Thanks Jack.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question