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
275
Bind StyleTrigger on GroupByRecordPresenter to summary value
posted

Hi!

I'd like to know how can I create a style trigger for the GroupByRecordPresenter to show a different colour depending on the group summary value.

Example: Show red when group sum <> 0 otherwise leave as default.

This style currently sets the background of all group rows to red.

<Style TargetType="{x:Type igWPF:GroupByRecordPresenter}">
     <Setter Property="Background" Value="Red" />
</Style>

The problem is I don't know to which property I should bind the trigger to.

Thanks in advance,

Ricardo

Parents
  • 138253
    Verified Answer
    Offline posted

    Hello Ricardo,

     

    Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I copied the default Style of the GroupByRecordPresenter and bound the Background of a Border from its Template called “highlight” to the Record’s Description. I also used a converter to check if “Count = 1” is contained in the description and if yes I return Red color otherwise I returned the default color which is located in the App.xaml files in the Application’s Resources. You can modify the check in the Converter’s Convert method as per your requiremtns. Please let me know if this helps you or you have further questions on this matter.

     

    Looking forward for your reply.

    XamDataGridGroupByPresenterColors.zip
Reply Children