Reputation: 460
I have an event in my data grid
private void PatientsDataGrid_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
Editor();
}
but whenever I accidentally double clicked the side scroll bar of the data grid, that event always triggers. so what can I put inside an If
statement so that whenever I just accidentally double click the scroll bar, it will skip the Editor();
?
Upvotes: 0
Views: 82
Reputation: 3061
Try to set MouseDoubleClick
event handler on the DataGridRow
level.
<DataGrid>
<DataGrid.Resources>
<Style TargetType="DataGridRow">
<EventSetter Event="MouseDoubleClick"
Handler="PatientsDataGrid_OnMouseDoubleClick"/>
</Style>
</DataGrid.Resources>
</DataGrid>
Upvotes: 2