How to set the current cell in a DataGridView with code? (C#)
2011-03-26 16:12:02
To set the current cell programatically in a datagridview is not enough with marking it as selected, you'll need to use the next code:
dataGridView1.CurrentCell.Selected = false; dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Selected = true; dataGridView1.CurrentCell = dataGridView1.SelectedCells[0];