[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

DataGridView Set SelectedItem

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
ProdigyOne2k
Asked:
ProdigyOne2k
1 Solution
 
JackOfPHCommented:

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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now