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
Dynamic Value Trigger
posted

Hello all,

I have a xamDataGrid with N number of objects.  Any one of my objects can be set as the "Base Line" object which is a property in my ViewModel. In a DataGrid column I would like for any values that are not equal to the Base Line's value, to change the color.  This will allow the user to see all changes from the base line very easily.  Is there DataTrigger support that can handle this dynamic problem?

 

Thanks,

 

KP

Parents
No Data
Reply
  • 30945
    Offline posted

    Hello,

     

    I have created a sample application that demonstrates an approach for implementing the functionality that you are looking for. The approach uses a Style with an DataTrigger for the CellValuePresenter. The DataTrigger’s Binding property is set to a MultiBindig object which contains two Binding objects. The first is Binding to the BaseLine propery and the second is to Record.DataItem of the CellValuePresenter. In the Convert method of MultiValueConverter  is calculated whether the value of the Record.DataItem is equal to the BaseLine.

     

    If you need any further assistance on this please do not hesitate to ask me.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

    DynamicCVPBackgroundDepOnProperty.zip
Children