Hello to all. A question.

How to programmatically change the current row in a DataGridView? Do not select, and make the current! Ie in the DataGridView display, it will appear as selected, and a black triangle will build on it. I need to change the current row to be added to the DataGridView. I subscribe to the event and do this:

this.dataDataGridView.RowsAdded += (s, e) => { this.dataDataGridView.CurrentCell = this.dataDataGridView.Rows[e.RowIndex].Cells.OfType<DataGridViewCell>().First(c => c.Visible); }; 

The added line is highlighted, but the black triangle remains where it was. How to move it?

Tell me please

  • you set the current cell, but not the row, look here at stackoverflow.com/questions/8635731/… - user2455111
  • The CurrentRow property of the DataGridView is read only. It is necessary to do through the current cell ... but one fig does not work. And for the link you gave, the result was also not found - Bretbas
  • Well, does anyone know? - Bretbas

0