Hi,
I want to background one column's cells according to the value in another cell.
I have created a style which works great:
<
Style x:Key="vlBackgroundStyle" TargetType="{x:Type igDP:CellValuePresenter}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Cells[6].Value}" Value="True">
<Setter Property="Background" Value="Green" />
</DataTrigger>
</Style.Triggers>
</Style>
the only problem is that it applies to all cells. i want the style to apply only to one cell.
how do I accmplish that?
I figured I need to do simething like
<igDP:Field Name="Value" Label="Value">
<igDP:Field.Settings>
<igDP:FieldSettings CellValuePresenter="{StaticResource vlBackgroundStyle}"/>
</igDP:Field.Settings>
</igDP:Field>
but that's not the correct syntax... Thank You
Are you sure that this is the correct syntax?
the compiler marks those lines as incorrect syntax...
Hello,
This is the correct syntax but probably the XamDataGrid has autogenerated a FieldLayout and is using it rather than the one you have applied the style to. Have you set AutoGenerateFields to false? Moreover, you can try setting the style in code behind - FieldLayoutInitialized event.