I have the following DataGrid:
<DataGrid AutoGenerateColumns="False" Name="dgPanelLogs">
<DataGrid.Columns>
<DataGridTextColumn Header="ID" SortMemberPath="ID"
x:Name="columnID"
Binding="{Binding Path=ID}"
IsReadOnly="True"
Width="50*"
SortDirection="Descending" >
</DataGridTextColumn>
<DataGridTextColumn Header="Time" SortMemberPath="Time"
x:Name="columnTime"
Binding="{Binding Path= Time, StringFormat='{}{0:dd/MM/yyyy HH:mm:ss}'}"
IsReadOnly="True"
Width="140*"
SortDirection="Descending">
</DataGridTextColumn>
<DataGridTextColumn Header="Event" SortMemberPath="Event"
x:Name="columnMessage"
Binding="{Binding Path=Message}"
IsReadOnly="True"
Width="350*"
SortDirection="Descending" >
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
My new requirement is to change rows to red when a certain value is encountered. Specifically, I have to retrieve a new boolean value with each row's data, and if it's true I need to set that row's text to red.
What's the best way to do this?