I have a datagridview that gets populatedfrom an XML file when the form loads. One of the XML fields indicates which datagridview row was selected when the application closed. When I load the form and I can find the row and set it to "selected". This works and the row gets highlighted (selected = true) the problem that I'm having is the row selector (little black triangle on the left) always points to the first row until the user clicks the grid. After that the highlighted row and the row selector agree. Is there another property to set the row selector?


Here's the code that I'm using to select the row.
vb Code:
  1. For i = 0 To dsLoads.Tables("Loads").Rows.Count - 1
  2.     dv = Me.grdLoads.Item("loaded", i)
  3.     If CType(dv.Value, Integer) = 1 Then
  4.         row = i
  5.         grdLoads.Rows(row).Selected = True
  6.     End If
  7. Next