I'm customizing a WPF DataGridCell style, but once I've done this double click to edit no longer works. I've also tried to manually call myDataGrid.BeginEdit, but nothing seems to happen. This is code similar to what I have:
<Style x:Key="MyCell" TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border>
<TextBlock />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I assume the problem is that because I'm overriding the ControlTemplate, an editor no longer exists? If that's the case, is their a way I can sort this to use the default editor?
Instead of creating a custom
ControlTemplate, you should create a custom column type and override theGenerateElementmethod to return an instance of your custom type: