tags:

views:

99

answers:

2

how can i select full and first row of datagridview in vb.net on form_Load

A: 

DataGridView.SelectedIndex = 0

Eric
+1  A: 

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 Morillo