How can I use DataTriggers in a DataGridColumHeader? With this code below it doesn’t work. Someone got any idea how i can fix this?
<DataGridTextColumn.HeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Background" Value="#FFFFBD21" />
<Style.Triggers>
<DataTrigger Binding="{Binding HasChangedRows}" Value="false">
<Setter Property="Background" Value="#66FFBD21"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.HeaderStyle>
Check This Code in a new solution and you will see that it should work if HasChangedRows Binding is correctly set. You can use the checkbox to change the value of HasChangedRows
and code behind:
Final result:
And