Solved

DataGridView Set SelectedItem

Posted on 2009-04-13
1
360 Views
Last Modified: 2013-11-26
Hey
I need to figure out how to set the selected item on a DataGridView

IE: - we enter in sales order # 084756 - hit create - then it selects that sales order # automatically instead of just refreshing and selecting the highest sales order #

0
Comment
Question by:ProdigyOne2k
1 Comment
 
LVL 15

Accepted Solution

by:
JackOfPH earned 250 total points
ID: 24134579

Private Sub SelectOrderNo(byval orderNumber as string)

For each row as DatagridviewRow in Datagridview1.rows

If row.Cell(colOrderNumber.index).Value = orderNumber then
       row.selected = true
next

End Sub
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

809 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