KB Article A2845
Visible to All Users

How to cancel the default processing of the GridControl mouse events

Description:
I am trying to use the Grid DoubleClick event to implement some custom functionality. When an end-user double-clicks a group row, it is expanded or collapsed. Is there any way to prevent this behaviour?

Answer:
Yes, to do this you should handle the GridControl’s DoubleClick event. Within this event you can cast the EventArgs to the DevExpress.Utils.DXMouseEventArgs class and set the Handled property to true

C#
private void gridControl1_DoubleClick(object sender, System.EventArgs e) { ((DevExpress.Utils.DXMouseEventArgs)e).Handled = true; }

See Also:
Why is the DoubleClick event for the GridView not triggered?
How to make the grid activate its in-place editor on double click only
Why is the MouseUp event for the GridView not triggered?

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.