How do I catch a doubleclick in my datagrid

Platform: WinForms| Category: Datagrid

The problem is that the first click of a double click may be caught by the datagrid (and used to activate the cell) while the second click goes to the TextBox for the columnstyle object. This means the TextBox thinks this is a singleclick, and does not fire its doubleclick event. One solution is to mark the time of the click caught by the datagrid. Then look at this time in the TextBox’s mousedown handler to see if in fact the single click being looked at by the TextBox is part of a double click. You can download a sample (C#, VB) that illustrates how this might be done.

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.