I added a datagrid in a wpf application.
<DataGrid ItemsSource="{Binding Projects}" SelectedItem="{Binding SelectedProject}" MouseDoubleClick="DataGrid_MouseDoubleClick" />
and here is my code behind
private void DataGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if selected row is header
then do this
else
do this
}
Now question is how I came to know which one is double clicked. It is header or a row. How I can find it out.
Instead of adding double click event in DataGrid, add sperate event for DataGridRow and DataGridColumnHeader.
Updated XAML:
And here is code behind.