Greetings,
In an WPF DataGridTemplateColumn I have a CellTemplate using a ListView and a CellEditingTemplate using a DataGrid.
<DataTemplate x:Key="LimitsTemplate">
<ListView ItemsSource="{Binding Limits}" IsEnabled="False">
<ListView.ItemTemplate>
...
</ListView.ItemTemplate>
</ListView>
</DataTemplate>
<DataTemplate x:Key="LimitsEditingTemplate">
<toolkit:DataGrid ItemsSource="{Binding Limits}" ...>
...
</toolkit:DataGrid>
</DataTemplate>
The problem I am facing is how to force the column into edit mode on double click? This is the default behaviour for the other columns and I believe for the DataGrid in general. Pressing F2 starts edit mode, but double click using mouse does not.
If I set the ListView.IsEnabled to False then the double click works, but then I have a disabled list view which doesn't look right and any style hack feels like an ugly kludge.
Note that I have tried single click editing which didn't do the trick.
Any help appreciated, thanks!
Of course as soon as I ask SO, the answer materializes :) If I use the FindVisualParent method from the single click editing trick and wire that up to the list view double click it all works as expected:
and in the code behind: