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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Lost selection on RightMouse-Click

Thread ID:





98638 Mar 14,2011 02:55 PM UTC Mar 22,2011 05:50 AM UTC WPF 1
Tags: GridControl
Administrator [Syncfusion]
Asked On March 14, 2011 02:55 PM UTC

Hi there,

how can I prevent my selection for unselection when clicking the right mouse button?

I'm calling with the right mouse button a context menu, e.g. to copy the selected cells. But when clicking the right mouse button my selection is gone.

Do you have any suggestions?


Mayavel K [Syncfusion]
Replied On March 22, 2011 05:50 AM UTC

Hi Andreas,

Thank you for using Syncfusion products.

The mouse right click event can be prevented from changing the selected item as follows. This will retains the previous selected item when left button is clicked.

[Code Snippet] [C#]

void dataGrid_ModelLoaded(object sender, EventArgs e)
this.dataGrid.PreviewMouseRightButtonDown += new MouseButtonEventHandler(dataGrid_PreviewMouseRightButtonDown);

void dataGrid_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)

// Any process can be implemented here

e.Handled = true;

Please find the attached sample for your reference.

Mayavel K



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon