user1730250
user1730250

Reputation: 592

changing text color of an xamdatagrid

I found out how to change the text color from a xamdatagrid cell. Right now I'm doing it like this:
rec.FieldLayout.Fields["Message Category"].Settings.CellValuePresenterStyleSelector = colors;
rec is a datarecord. and colors is a StyleSelector
is there anyway I can do this but instead of just changing one cell I can change the entire row?

Upvotes: 0

Views: 1644

Answers (1)

Kurubaran
Kurubaran

Reputation: 8902

You can define a property in the ViewModel which based on the conditions decides whether to set the foreground color for a row.

<DataTrigger Binding="{Binding IsRowValid}" Value="True">
    <Setter Property="TextElement.Foreground" Value="Red"/>
</DataTrigger>

Upvotes: 1

Related Questions