Conditional Formatting

0
Is there any way to add conditional formatting to a data grid. for example if a value in one cell is greater than a specified value then the row turns red etc… Obviously this is used all of the time Excel and would be a really useful feature
asked
2 answers
0

Nope, there is none by default. 

The easiest solution is to use a listview or template grid and create the overview. With these you have the option to add conditional formatting and styling. 

Furthermore there is a datatables widget in the appstore that does what you want, give styling to a specific row,column or cell depending on the data. The implementation of this widget might be a bit harsh at first:

https://appstore.home.mendix.com/link/app/2702/

answered
0

Yep, but not by default. Use this Appstore-item: https://appstore.home.mendix.com/link/app/106254/

It allows to add a class to a Datagrid’s column, based on a javascript rule. For the available classes see https://docs.mendix.com/howto/front-end/styles. Add widget ‘cellStyler’ to you page, 

These settings, first rule colors column5 (Decimal) red (the last on is overriden by ‘selected’), second rule is appearently wrong, so no changes, the third colors column4 (Bollejan) green of the DateTime in column5 is more than one year in the past, and the fourth colors column3 (Integer) red if the integer is >= 5

Leads to the conditional formats:

Kuddo’s for Eric Tieniber for creating this Widget!

answered