Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to stop the double click event in a datagridview from being raised?

I have a datagridview in which one of the columns is a checkbox. I handle the CellContentClick event to update information everytime the user check or uncheck one of the checkboxes. It works great. My problem is that when I double click a checkbox CellContentClick is called and then CellContentDoubleClick after that. I want to annul the call for CellContentDoubleClick. Is there a way to do this?

like image 417
user990692 Avatar asked Feb 05 '12 22:02

user990692


1 Answers

You can remove event handler from datagrid.

     EventHandler eventHandler = new EventHandler(YourdataGridview_CellContentDoubleClick);
     YourdataGridview.CellContentDoubleClick -= eventHandler; 
like image 75
David Jazbec Avatar answered Oct 03 '22 15:10

David Jazbec