Datagridview don't highlight the first row

Answered
0
0

Hi,

If I select the first row in a datagrid, the row don’t hightlight.

If i select another row, then I can select the first too.

I attach a sample project.

 

if I do first:

DataGridView1.ClearSelection()
DataGridView1.CurrentCell = Nothing

it works but I don’t this is the right way

best

Cristian Zerbinati

  • You must to post comments
Best Answer
0
0

You are not selecting the row, you are changing the current cell. The first cell (0,0) is already the current cell so nothing changes. When you change the current cell to (1,0) it happens that the row 1 gets selected because the default SelectionMode is FullRowSelect. To select a row use the Selected property of the row.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.