Saiyine
Punto Com

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];

Rollos antiguos

2011-03-10 14:59:39 - Serpientes en el compilador.

2011-03-10 14:57:55 - Abrir una ventana de MS-Dos en la carpeta seleccionada.

2011-03-09 14:54:57 - Gentoo no estaba muerto.

2011-03-09 14:53:43 - Cierra la ventana.

2011-03-09 14:51:00 - Arsys 25 - otros 5.

Saiyine

Selfie of meHi! Welcome to Saiyine Punto Com where I talk about anything that goes through my mind!

Puedo prometer y prometo que a la mayor brevedad aquí irá un menú o algo asín.