So basically the very first column in the first row is always selected, I can't figure out a way to have it so the gridview has no selected cells. Any help?
I was having quite a bit of trouble with this myself. I have a user control with a DataGridView that is populated on application/form load. The selection of the first row seems to happen after databinding is complete and the grid is populated/rendered. The user control load event (and presumably, form load as well) fires prior to that - so calling gridView.ClearSelection() or nullifying gridView.CurrentCell in those load events has no net effect.
What finally worked for me was calling .ClearSelection() from the DataBindingComplete event of the DataGridView itself. This worked like a charm.
I had this same issue and nothing was working. The solution that worked for me was setting the 'Tabstop' property to False and calling the ClearSelection() method immediately after the data bind.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With