I have DataGridView to load some data programmatically. After inserting my data I am showing the DataGridView . Here by default the 1st row 0th column cell is selected. But I don't need that. I have tried to disable that option.
datagridviewname.currentcell=null
But it will not work. Any body can help me to solve my problem.
Set CurrentCell
Selected
property to False
like:
dataGridViewName.CurrentCell.Selected = false;
On the DataGridView create an event for DataBindingComplete
then add this method datagridview1.ClearSelection()
private void datagridview1_DataBindingComplete(object sender, EventArgs e)
{
datagridview1.ClearSelection();
}
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