We are using DataTriggers in GridTemplateColumns like documented here:
https://www.syncfusion.com/kb/6785/how-to-load-different-images-in-gridcell-based-on-cell-value-in-wpf-datagrid-sfdatagrid
We use an ObservableCollection as ItemsSource, the collection elements are plain objects without INotifyPropertyChanged (Database models). We modify data inside of the collection elements, and use SfDataGrid.View.Refresh to force a refresh on the view to present the changes. All Column types refresh their data as expected, except for this one:
<sf:GridTemplateColumn HeaderText="Freigabe">
<sf:GridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Margin="5 0 5 0" Width="16" Height="16" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Setters>
<Setter Property="Source" Value="{x:Null}"/>
</Style.Setters>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Bestellung.IstFreigegeben}" Value="True">
<Setter Property="Source" Value="{StaticResource IconOkSmall}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Bestellung.IstGesperrt}" Value="True">
<Setter Property="Source" Value="{StaticResource IconOnHoldSmall}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Bestellung.IstFreigabeAusständig}" Value="True">
<Setter Property="Source" Value="{StaticResource IconHourglassSmall}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</DataTemplate>
</sf:GridTemplateColumn.CellTemplate>
</sf:GridTemplateColumn>
We assume that the DataTriggers are not executed on the cell,and the cell content stays the same as before the refresh.The binding has a different value.Whatdo we need to do to have above cell to correctly refresh itself with updating based on the StyleTriggers.We want to prevent using a Converter,asfor code maintenance it is more efficient for us to useDataTriggers.Thanksfor your suggestions.