We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

In GridDataBoundGrid control, CurrentCellControlDoubleClick event is being fired when we double click with mouse right button. We need this event only when we double click with mouse left button. How can we achieve this?

Thread ID:





66920 Aug 6,2007 04:03 AM UTC Aug 7,2007 04:42 AM UTC WinForms 2
Tags: GridControl
Asked On August 6, 2007 04:03 AM UTC


Here is a GridDataBoundGrid 'gridDataBoundGrid1'.It has three columns(Name, Location and Amount);
Static columns: Name and Location.
Dynamic columns: Amount column contains Textbox control.

How i have implemented?
Took two events
1)this.gridDataBoundGrid1.CellDoubleClick +=new GridCellClickEventHandler(gridDataBoundGrid1_CellDoubleClick);
2)this.gridDataBoundGrid1.CurrentCellControlDoubleClick +=new ControlEventHandler(gridDataBoundGrid1_CurrentCellControlDoubleClick);

The first event fires when we double click on static columns whereas second event fires when we double click on dynamic columns (columns which contains controls). Second event fires only when the control in the cell contains focus only.

1) When i right double click on static columns it should not display the message, that i have fixed by adding code
"if(e.MouseEventArgs.Button != MouseButtons.Right)"
MessageBox.Show("Double Click");

2) How can i prevent from showing message when user right double clicks on control based columns(Amount)?

Below is the attchment for this example.



haneefm [Syncfusion]
Replied On August 6, 2007 05:56 PM UTC

Hi Raghavendra,

You can use the Control.MouseButtons property to find mouse button when double click inside the grid textbox cell. Below is a code snippet

private void gridDataBoundGrid1_CurrentCellControlDoubleClick(object sender, ControlEventArgs e)
if (Control.MouseButtons != MouseButtons.Right)
MessageBox.Show("Current cell control double click" );

Best regards,

Replied On August 7, 2007 04:42 AM UTC

Thank you Haneef, it works fine.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon