How to catch and handle right-click ?

Hi,
I am trying to have the following behaviour with Syncfusion GridControl :

-> Selecting a range of cells
-> Right-click on the selected range
-> A drop-down menu opens with 'span cells' option.
-> Span the selected range using the 'covered cells' feature.

Now, when I right-click on a selected range it is automatically unselected. I don't want this.
I want to intercept the right-click and that the selected range stay as it is so that I can then span selected cells.

I've tried the 'syncfusionGrid_CellMouseDown' method but couldn't prevent the selected range of being unselected.

I am quite new to WPF and Syncfusion. I'll be gratefull for your help.

Thanks in advance

Nazim YENIER
SAGE Experts-Comptables

3 Replies

CB Clay Burch Syncfusion Team August 12, 2009 08:44 AM UTC

Attached is a sample with a context menu that has a menu item that covers the selected cells.





ContextMenu2_a28cb75c.zip


NY Nazim YENIER August 12, 2009 10:11 AM UTC

Thanks a lot, it works great.

In fact, all I needed was the following :

private void syncfusionGrid_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
}

Nazim YENIER


MS Mohamed Suhaib Fahad A. Syncfusion Team August 18, 2009 09:45 AM UTC

Hi Nazir,

Thanks for your feedbacks. We are glad you got it working.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,

Loader.
Up arrow icon