WPF Change datagrid cell background color using a converter
问题 I have an WPF datagrid. There are two columns of type datetime which I need to compare and according to the compare result, I set a cell background color for the two cells in the current column and row. I do this for each datagrid row. In order to do this I use a converter. <my:DataGridTextColumn Binding="{Binding Path=Date1, StringFormat=\{0:dd/MM/yyyy\}}" Header="Date"> <my:DataGridTextColumn.ElementStyle> <Style TargetType="TextBlock"> <Setter Property="Background"> <Setter.Value>