Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove the current cell focus from A Windows Forms datagridview?

How can I remove the current cell focus from a Windows Forms datagridview ? I have a dialog with some datagridforms and initially I don't want to have a cell selection. Actually in every gridview the cell [1,1] is selected

I have already searched in some forums, but the provided solutions doesn't work. For example often it is recommended to set CurrentCell = null --> but this has no effect. Has anybody another solution, which really works ;-) ?

like image 706
Kottan Avatar asked Sep 19 '25 08:09

Kottan


1 Answers

dataGridView.ClearSelection();
dataGridView.CurrentCell = null;
like image 71
Yulia Avatar answered Sep 22 '25 08:09

Yulia