Is there an EASY way to change the background color of a row based on data in that row?
Any help will be appreciated.
Hi,
You can easily change the background of a row(record) based on the value of one of its cells using style triggers.
<igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:DataRecordCellArea}"> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path= Record.Cells[1].Value}" Value="Sales"> <Setter Property="Background" Value="Orange" /> </DataTrigger> </Style.Triggers> </Style> </igDP:XamDataGrid.Resources>
I have created and attached a working sample application, demonstrating this approach.
Best Regards,Yanko