Solved

DataGridView Set SelectedItem

Posted on 2009-04-13
1
350 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
Comment Utility

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now