This is a migrated thread and some comments may be shown as answers.

How to get selected cell on MouseDoubleClick event?

2 Answers 471 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tobias
Top achievements
Rank 1
Tobias asked on 27 Feb 2019, 12:21 PM

Hello

I'm using RadGridView and try to handle the MouseDoubleClick-Event. My problem is to get the RadGridCell the user has double-clicked on.

Can you help me with this?

Thanks!

Best regards

Tobias

 

 

2 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 04 Mar 2019, 08:41 AM
Hi Tobias,

Thank you for your interest in our RadGridView control for WPF.

What you could try is to use EventManager.RegisterClassHandler() method to subscribe to all GridViewCell's in the window. Check the following code snippet:
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        EventManager.RegisterClassHandler(typeof(GridViewCell), GridViewCell.MouseDoubleClickEvent, new RoutedEventHandler(OnMouseDoubleClickEvent));
    }
 
    private void OnMouseDoubleClickEvent(object sender, RoutedEventArgs e)
    {
        var gridViewCell = e.Source as GridViewCell;
    }
}

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Tobias
Top achievements
Rank 1
answered on 04 Mar 2019, 09:21 AM

Hello Dinko,

thanks, that works. I can use the TabIndex-Property to distinguish on which cell the user has clicked.

Kindly regards

Tobias

Tags
GridView
Asked by
Tobias
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Tobias
Top achievements
Rank 1
Share this question
or