Intento seleccionar una línea del DataGridView así:
Código:
Dim lastRow As Integer = DGV.RowCount
MsgBox(lastRow)
DGV.Rows(lastRow).Selected = True
El messagebox me devuelve el valor correcto, pero cuando toca a seleccionar essa misma línea me devuelve un error:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Pero si le asigno yo un valor, por ejemplo:
Código:
DGV.Rows(5).Selected = True
La selecciona sin cualquier problema.