I have a question regarding WPF DataGrid. For the sake of IDataErrorInfo validation I would like to set the entire selected row as editing - by that I mean setting every cell's (in that row) data template from CellTemplate to CellEditingTemplate.
This is one column for example:
<DataGridTemplateColumn Header="Note">
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Name="textBoxNote" Text="{Binding Note, ValidatesOnDataErrors=True}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Note}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Is that possible in XAML (triggers of some kind)? How would I do that in codebehind? I have found the solution with two separate styles as resources and then programamatically toggling between them in Row_Selected and Row_Unselected events, but I would rather use the existing above XAML code for columns (with separate CellTemplate and CellEditingTemplate).
Can anyone point me the right way?
Thanks in advance. Best regards, DB