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.
Unfortunately, activation email could not send to your email. Please try again.

Lost selection on RightMouse-Click

Thread ID:

Created:

Updated:

Platform:

Replies:

98638 Mar 14,2011 10:55 AM Mar 22,2011 01:50 AM WPF 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 14, 2011 10:55 AM

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?

Greetings
Andreas


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

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.

Thanks
Mayavel K



MouseRightClick_Sample-1325868245_94e3277c.zip

CONFIRMATION

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.

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.

;