I have the following data trigger in a style within a cell presenter style
<igDP:Field Name="myfield" Width="Auto"> <igDP:Field.Settings> <igDP:FieldSettings> <igDP:FieldSettings.CellValuePresenterStyle> <Style TargetType="{x:Type igDP:CellValuePresenter}" > <Style.Triggers> <DataTrigger Binding="{Binding Path=IsMyValue}" Value="True"> <Setter Property="Background" Value="Red" /> </DataTrigger> </Style.Triggers> </Style> </igDP:FieldSettings.CellValuePresenterStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
In my view model, I have
public Boolean IsMyValue { get { //etc } }
I attached a break point tothe getter of IsMyValue and it's never being called at any point.When i remove the data trigger and just set the background within the syle, it works fine.
Any ideas what might be breaking?
Thanks
The DataContext that the DataTrigger uses is the DataRecord. You should be getting an exception in the ouput window that IsMyValue property cannot be found on object DataRecord. To resolve this, you have to change the Binding Path expression to DataItem.IsMyValue. Let me know if that works on your end.
great thanks