The reason that creating an empty DoubleClick event method does not help will be performed in addition to other operations that occur when you double-click.
If you look at the code generated by Windows, or at examples of programmatically adding event handlers, you use + = to assign an event handler. This means that you add this event handler in addition to others that already exist, you could fire several event handlers in a save event.
My instinct would be to override the DataGridView class, then override the OnDoubleClick method and not call the base OnDoubleClick method.
However, I tested it very quickly and see some interesting results.
I put together the following test class:
using System; using System.Windows.Forms; namespace TestApp { class DGV : DataGridView { private string test = ""; protected override void OnDoubleClick(EventArgs e) { MessageBox.Show(test + "OnDoubleClick"); } protected override void OnCellMouseDoubleClick(System.Windows.Forms.DataGridViewCellMouseEventArgs e) { MessageBox.Show(test + "OnCellMouseDoubleClick"); } protected override void OnCellMouseClick(System.Windows.Forms.DataGridViewCellMouseEventArgs e) { if (e.Clicks == 1) {
Then I inserted this into the window form, adding a checkbox column and running the program.
On a new start, double-clicking on the flag displays the message on "1 click OnDoubleClick".
This means that OnCellMouseClick is executed in the first part of the double-click, and then OnDoubleClick is executed in the second click.
In addition, unfortunately, deleting the call to the basic methods does not seem to prevent the checkbox from getting the click passed to it.
I suspect that for this approach to work, it may have to be taken further and redefined by DataGridViewCheckBoxColumn and DataGridViewCheckBoxCell, which ignores double-clicking. Assuming this works, you could stop double-clicking on the checkbox, but still allow it on other column controls.
I posted an answer to another question that talks about creating custom columns and DataGridView cells in here .