how can i select full and first row of datagridview in vb.net on form_Load
Asked
Active
Viewed 4.0k times
3 Answers
11
I´m not sure if all these lines are strictely necessary, but this should work:
If MyDataGridView.RowCount > 0 Then
MyDataGridView.ClearSelection()
MyDataGridView.CurrentCell = Me.Rows(0).Cells(0)
MyDataGridView.Rows(0).Selected = True
End If
Ah, if you want to select the full row, the DataGridView Selection Mode property must be FullRowSelect

Javier
- 4,051
- 2
- 22
- 20