change color in text or whole cell

0
Hello Can somebody send me some example how can i change color in text or whole cell in datagrid 2 according value ( +,-,<,>,=). I found Cell Styler but is it old modul for mendix 7 ....   Thanks 
asked
5 answers
1

Hey!

 

I believe that for this purpose you can make use of dynamic classes where you can mention 

 

if

$entity/attribute>=100

then row-color-red

else

row-color-green

 

You can define dynamic classes in the appearance tab of your grid as follows:image.png

and define custom classes as follows:

 

.row-color-red { background-color: #ffcccc; /* Light red */ }

.row-color-green { background-color: #ccffcc; /* Light green */ } 

answered
0

Hey!

 

Were you able to make use of the dynamic classes in the appearance tab?

answered
0

Hi Tomas,

 

Can you be a bit more specific on what it is you want?

 

Am I correct that you'd like to apply custom styling to the full cell containing any of the following characters:

  • +
  • -
  • <
  • >
  • =
answered
0

I want to compare values in DG2. For example: if the value in datagrid2 is greater than 10, then color the row red, otherwise color it green

image.png

answered
0

Hi Thomas,

 

when editing the datagrid2 column, you have the option for dynamic cell classes.

In this write your if else statement with the classes you would like the cell to have under the circumstance.

Make sure to add the classes in the css file.

image.png

answered