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

right click in selected rows GridDataControl

Hi,

I'm using Syncfusion v 9.404.0.62.

With the GridDataControl multiple row selection, right clicking inside the selected rows deselects everything else except the row I clicked on?

How do I keep the selections selected when it is right clicked on?

Thanks,
Rich 

1 Reply

RA Rajasekar Syncfusion Team July 10, 2012 07:11 AM UTC

Hi Rich,

 

Thank you for your update.

 

You can achieve your requirement by using the below code snippet,

 

Code Snippet[C#]

 

       this.dataGrid.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);
        
        void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
        {
            if (e.Reason == GridSelectionReason.MouseDown && Mouse.RightButton == MouseButtonState.Pressed
                && this.dataGrid.Model.SelectedRanges.AnyRangeContains(e.ClickRange))
            {
                e.Cancel = true;
            }
        }

 

Please let us know if you have any queries.

 

Thanks,

Rajasekar


Loader.
Live Chat Icon For mobile
Up arrow icon