Custom CSS for one cell inside a datagrid

I am using a data grid with one editable column where you can choose A, B or C from an enumeration drop down. When A is choosen the background for this cell should become red. When B is choosen the background should become Blue. And when C is choosen the background should remain default.   Is it possible to implement this with mendix?   it is not possible to get the $currentObject or the $currentRow inside a data grid using dynamic classes.
2 answers

yes this is possible by using Java Script or Jquery 

add a class to all rows.

add Event Listener to that class using forEach loop of Javascript 

in this you can access this object which refer the current object 

so you can write you JS to change styling like  = red;

you are gettin row in this object the you can also target any column of the row by using 


in jquery




Sanjay Kushwah


Hi Bertran,

As you using enum attribute for a particular attribute you can use the dynamic classes for achieving this In the sense based on particular enum values as A,B and C if the user given the input as A then the background color wants to be red similarly for others aswell we can do.use if then else conditions to achive this.

Hope this information helps you.