hey i wanna change row foreground color according to a boolean in the model, whats the best way of doing it?
+4
A:
Define the style as following (IsBlah is a boolian property):
<Style x:Key="MyRowStyle" TargetType="{x:Type dg:DataGridRow}">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="DarkBlue"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsBlah}" Value="False" >
<Setter Property="Background" Value="DarkGray" />
<Setter Property="Foreground" Value="White" />
</DataTrigger>
</Style.Triggers>
</Style>
Your DataGrid should have a custom RowStyle. (RowStyle="{StaticResource MyRowStyle})
Boris Lipschitz
2009-08-17 05:30:56
Just FYI - You should be leaving this type of feedback as a comment, not an answer.
Will Hughes
2009-11-16 10:28:44
A:
How would you go about styling individual cells instead of complete row styling
Garth
2009-11-16 10:39:06
@Garth, no offense, but read what Will said to you on your previous post. Post this type of entries in comments. Posting again after being pointed seems either ignorance or arrogance. Both are not helpful here.
Yogesh
2009-11-16 10:43:55