How I can change the color of row in data grid 1 and 2 based on Enumeration values?

0
Enum values like 'Active' or 'Inactive' (P.s dynamic classes didn't worked)
asked
2 answers
1

Hi Mykyta,

 

Sorry, I didn't see that you replied to my message.

When opening your DataGrid2, add a 'Dynamic row class'. The expression should look something like this:

 

if $currentObject/{YourEnumAttribute} = {YourEnumValue} then '{YourClass}' else empty

 

You can obviously expand this logic as you wish.

 

Next, add the following lines to whichever Stylesheet you are using in your application:

.{YourClass}{
    .td {
        background-color: red;
    }
}

This code will make the row that matches the ENUM value color red. You can obviously change the color as you seem fit.

 

All the values between '{ }' should be changed with your own values.

 

Good luck!

 

answered
0

Hi Mykyta,

 

For DataGrid 1, you can use this module in order to style your table rows. With DataGrid 2 however, it is more straight forward and you can achieve this with just Dynamic Classes.

 

Good luck!

answered