Conditional text color for rows of a DataGrid?

I have a datagrid associated with a database table. I need to change the forecolor of a row to blue depending on the presence of a value in one of its columns. Is there a way I can do this? I tried IValueConverter, but I suppose I can use it only for one cell at a time.

+7
source share
1 answer
<DataGrid> <DataGrid.CellStyle> <Style TargetType="{x:Type DataGridCell}"> <Style.Triggers> <DataTrigger Binding="{Binding SomeProperty}" Value="SomeValue" > <Setter Property="Foreground" Value="Blue" /> </DataTrigger> </Style.Triggers> </Style> </DataGrid.CellStyle> </DataGrid> 
+19
source

All Articles