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:
if [CurrentObject.Status] = "Active" then return "enumeration-active"
else if [CurrentObject.Status] = "Inactive" then return "enumeration-inactive"
else return ""
In your data grid, add a new column that contains a custom widget.
In the custom widget, add a container widget and set the Class
property to the output of the microflow you just created.
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: https://marketplace.mendix.com/link/component/106254