Solved

DataGridView Set SelectedItem

Posted on 2009-04-13
1
358 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

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

777 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