Reputation: 734
I have a DevExpress GridControl:
<dxg:GridControl ItemsSource="{Binding Path=MyData}" MouseDoubleClick="GridControl_MouseDoubleClick" />
In the event handler I can determine the focused row nicely by calling GetFocusedRow()
. However, the handler gets also called when the scroll bar gets clicked twice in quick succession.
How can I determine if the user actually double-clicked a row? Or can I easily attach an event handler to the rows without much restyling?
Thanks.
Upvotes: 1
Views: 3768
Reputation: 9496
This is all you need:
TableViewHitInfo hi = ((TableView)gridControl.View).CalcHitInfo(e.OriginalSource as DependencyObject);
if (hi.InRow)
{
//Do work...
}
Upvotes: 3
Reputation: 1044
Here -> Wpf datagrid row double click you can find a nice article for that topic.
Upvotes: 1