Is there a way to highlight all the modified rows on a DataGrid
? Since the grid is bound to a System.Data.DataTable
I figured I might be able to bind the color of each row to it's RowState
(example below), but that doesn't seem to work.
Any ideas?
xmlns:data="clr-namespace:System.Data;assembly=System.Data"
<Style x:Key="DataGridRowStyle" TargetType="{x:Type toolkit:DataGridRow}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" Value="Blue" />
</Trigger>
<DataTrigger Binding="{Binding RowState}"
Value="{x:Static data:DataRowState.Modified}">
<Setter Property="Background" Value="LightYellow" />
</DataTrigger>
</Style.Triggers>
</Style>
See Question&Answers more detail:os