I am display some data in DataGridiView.
By default cell edit is enabled on keystroke or on click, I want to disable it.
I want the cell value to be edited only on double click.
How do I achieve this?
Set the EditMode property of your DataGridView to EditProgrammatically. This makes editing begins only when the BeginEdit method is called.
Then handle CellDoubleClick event and call BeginEdit.
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
dataGridView1.BeginEdit(true);
}
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