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
180
Problem with DataTrigger
posted

Hi, I am trying to get a datatrigger to work to change the background of a cell based on a value. I have read all of the previous posts on this subject and I am still not able to get it to work. I think I am having trouble figuring out that the path should be.

The following it my datatrigger style:

<Style x:Key="NegativePresenterStyle" TargetType="{x:Type igDP:CellValuePresenter}">

<Style.Triggers>

<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=EarnedBase}" Value="-88242.7">

<Setter Property="Background" Value="Red"></Setter>

</DataTrigger>

</Style.Triggers>

</Style>

I have also tried substituting path with the following which all give errors or don't do anything

(DataItem).EarnedBase

Record.DataItem

(Record.DataItem).EarnedBase

Record.DataItem.EarnedBase

The following is my field settings xaml:

<igDP:Field Name="EarnedBase" Label="Earned Base" Row="0" Column="1">

<igDP:Field.Settings>

<igDP:FieldSettings CellValuePresenterStyle="{StaticResource NegativePresenterStyle}" />

</igDP:Field.Settings>

</igDP:Field>

Parents Reply Children
No Data