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

Implementing Right Click & Copy Selected Cells Functionality

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

2 Replies

AD Administrator Syncfusion Team February 19, 2004 06:18 AM

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.


JB John Bowm February 19, 2004 06:54 AM

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

Loader.
Live Chat Icon For mobile
Up arrow icon