Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
932
Row foreground color based on column's value.
posted

Hi,

I am also trying to set row Foreground color based on a particular column's value but my (Below) solution does work for Background color not  for Foreground color. Does anybody know how to set Forground color of entire row based on a Column's value.

<local:CvpBackgroundBrushConverter x:Key="cvpBackgroundBrushConverter"/>

<Style x:Key="cvpNegativeStyle" TargetType="{x:Type ig:DataRecordPresenter}">

<Setter Property="Foreground" Value="{Binding Path=DataItem.Price, Converter={StaticResource cvpBackgroundBrushConverter}}" />

</Style>

 

<ig:XamDataGrid Theme="Generic" x:Name="_grid">

<ig:XamDataGrid.FieldSettings><ig:FieldSettings AllowCellVirtualization="True" AllowEdit="False" /></ig:XamDataGrid.FieldSettings>

<ig:XamDataGrid.FieldLayoutSettings><ig:FieldLayoutSettings AutoGenerateFields="True" DataRecordPresenterStyle="{StaticResource cvpNegativeStyle}"  /></ig:XamDataGrid.FieldLayoutSettings>

</ig:XamDataGrid>

Thanks,

Naveen