I have this kind of problem. I normally select row in datagrid by left or right mouse click. But I need on right click run command. I use this code
<DataGrid.InputBindings>
<MouseBinding Command="{Binding ShowDWClickOnRightButton}" MouseAction="RightClick" CommandParameter="{Binding ElementName=myDataGrid, Path=SelectedItem}"/>
</DataGrid.InputBindings>
But this not working, because in command parameter I have null (no selected Item). Can you please give me some advice how to solve this?
Thank you