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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Implementing Right Click & Copy Selected Cells Functionality

Thread ID:





10998 Feb 19,2004 10:52 AM UTC Feb 19,2004 11:54 AM UTC WinForms 2
Tags: GridControl
John Bowm
Asked On February 19, 2004 10:52 AM UTC

Hi, I''ve got a grid control that implements the OnMouseDown event handler that checks for left click & number of clicks and then does the behavior I want. However, I''m trying to also implement a context menu when the user right clicks (to copy selected data to the clipboard). This is all fine except for the fact that, if the user selects (using the left mouse button, for example) a range of cells or rows, then uses the right mouse button to click on the selected cells to get the context menu, when the OnMouseDown event is entered, the selected cells are already changed to the item they''ve right clicked on. How can I stop this "unselecting" type of behavior? Is there some event prior to the OnMouseDown that is firing that I need to do something in? TIA

Administrator [Syncfusion]
Replied On February 19, 2004 11:18 AM UTC

There is a property that controls this behavior of which mousebutton can select cells. Try: this.gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left; This should prevent the right button from affecting any selections.

John Bowm
Replied On February 19, 2004 11:54 AM UTC

Clay, That appears to do the trick, thanks for the help! John


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

Live Chat Icon For mobile
Live Chat Icon