Change data grid cell color based on enum cell-value

3
Hi, We have a data grid that includes a column with enum values. (Good, Moderate, Bad). Is there a way to style the background color of the cell depending on the enum value? This way the "Good" value would display a green background, and "Moderate: Orange" and "Bad: red". I was thinking of adding code to the "Style" section of the "Edit Grid Column" pane, but don't know how to correctly formulate the condition for choosing the corresponding CSS background parameter.. Something like: (If "enumValue = _Bad" then background-color:red) etc.
asked
2 answers
0

Gonzo,

See this forum question and answer.

answered
0

Thanks Erwin for your answer.

I don't understand it completely yet. A suggested solution is in your link is:

.customGrid td[key="attributePath"] { font-weight: bold; }

But what is the code that I need to replace "attributePath" with to reference the specific enum-value of the attribute that is displayed in the cell? (How do I select "background: green;" if the enum value is "Good")

answered