I seem to keep fighting this irritating problem while navigating a datagridview.
One thing VB.NET does with datagridviews that to me is such a crock is that it always highlights the first row.
Why? When you've got 4-5 datagridviews on a form, you load the form and you're sitting there looking at all of these selected rows...and for what?
So you have to unselect rows.
grdview.CurrentCell = grdview.Item(1, 0)
ed = False
I am trying to get a currentrow index on my datagridview whenever one of two things happens:
1) User clicks a row.
2) User arrows up and down changing the rowindex.
The RowEnter property apparently fires prior to the row index changing. I keep getting the first row based on unselecting the default row OnLoad.
I need the NEW row index.
What property do I have to use to capture the new row index whenever there is movement between rows?
Private Sub grdviewWebQueue_RowChg(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grdviewWebQueue.RowEnter
If Activating Then Exit Sub
If dvWebQueue.Count > 0 Then
Dim msg As String = ""
Dim index As Integer = grdviewWebQueue.CurrentRow.Index
If (index = -1) Then
OutofHere = True
glQueueID = dvWebQueue(index)("pkid").ToString