Data grid-1

Hi all,   In data grid-1 For column how to apply background color based on enumeration status. I tried with dynamic class but there I am not getting the current object of data grid. So Please do comment if you have any suggestions.    Thanks in Advance.
2 answers

To apply background color to a column in a data grid in Mendix, you can use a custom microflow to set the class of the row based on the enumeration status. Here's an example:

  1. Create a new microflow that takes in the current object and returns a string representing the CSS class name. For example

if [CurrentObject.Status] = "Active" then return "enumeration-active"

else if [CurrentObject.Status] = "Inactive" then return "enumeration-inactive"

else return ""

  1. In your data grid, add a new column that contains a custom widget.

  2. In the custom widget, add a container widget and set the Class property to the output of the microflow you just created.

  3. In the CSS of your theme, add the following classes to style the background color of each row based on the enumeration status:

.enumeration-active {

background-color: green;


.enumeration-inactive {

background-color: red;



This should apply the background color based on the enumeration status for each row in the data grid.


I have used the Grid Cell Styler widget from the Marketplace for this: