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
close icon

Preserving selection when context menu pops up

Like the subject says, what's the recommended way to preserve the selection state of a GridDataBoundGrid if the user clicks on a cell contained in the currently selected range in a way to cause the context menu to pop up? The default settings seem to clear the selection, unlike XL and other programs. Thanks for any hints.

3 Replies

AD Administrator Syncfusion Team November 6, 2003 07:19 PM UTC

Try setting this property. this.gridDataBoundGrid1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left; It turns off selections with the right-click.


PZ Peter Zaborski November 6, 2003 07:50 PM UTC

Hi Clay, thanks for the quick reply. Close but not quite 100%. In XL, right clicking inside the selected range brings up the context menu. But right clicking outside of the selected range clears the selection (or selects the clicked on cell). Is this achievable without mouse event handling? -Peter


AD Administrator Syncfusion Team November 6, 2003 07:56 PM UTC

No, there is no property that yields this behavior. You could probably use grid.SelectionsChanging instead of a mouse event, but it still would be an event needed.

Loader.
Live Chat Icon For mobile
Up arrow icon