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

Cell Selection & Right Click

Hi, I would like to be able to select cells with either the left or right mouse button. If however, the user clicks with the right mouse button on a cell that is already part of a selection, I don''t want the selection to change. The SelectionChanging(...) method does not let you know which mousebutton was used to trigger the selection change, so I couldn''t cancel the change there. I thought perhaps I would trap the MouseDown(...) event before SelectionChanging(...) occurred to get which button was pressed, but for some strange reason, apparently the SelectionChanging(...) method occurs before the MouseDown(...) event. That seems particularly odd to me. In any case, how would you suggest finding out which button was used to change the selection, before the selection actually changes at all, so that it can be cancelled if necessary? Thanks

1 Reply

AD Administrator Syncfusion Team October 1, 2005 03:46 AM UTC

You can use Control.MouseButtons to test what mouse button is depressed in SelectionsChanging. This thread has a sample. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=32170

Loader.
Live Chat Icon For mobile
Up arrow icon