Please use this widget and add the rules as per your requirement.
Hope this is useful for you.
You have a couple of option, for example:
- If you use MX 9 you can use datagrid 2.0 and give the cell or container within that cell a specific class and use conditional visibility to show the right class
- With a normal datagrid you can use a widget like: https://marketplace.mendix.com/link/component/106254 to helpy you style the cell bases on the data
- You could also switch to a template grid or listview and use conditional visibility for the styling