I am wondering if it is possible to create double click event on autogenerated data grid in mvvm. So far my Data grid looks like:
<DataGrid AutoGenerateColumns="True" AutoGeneratingColumn="OnAutoGeneratingColumn"
CanUserSortColumns="False"
GridLinesVisibility="None"
CanUserAddRows="False"
SelectionUnit="Cell"
ItemsSource="{Binding ValuesView}"
CellStyle="{StaticResource CellStyle}"
CurrentCell="{Binding SelectedValue, Mode=TwoWay}" />
So in quick description Item source is a DataTable object, and I managed to bind single click to
CurrentCell="{Binding SelectedValue, Mode=TwoWay}"
property, and it works, on command so in view model I am reciving:
private DataGridCellInfo selectedValue;
public DataGridCellInfo SelectedValue
{
get => selectedValue;
set
{
selectedValue= value;
OnPropertyChanged();
// some operation I am making on DataGridCellInfo
}
}
Now Is it possible to without changing View model code, get same result on double click instead of single?