Change DataList Cell Style Depeing On Value

Tony Murday shared this question 5 months ago
Answered

I have a `datalist` which is working perfect the issue i am having is that i want to style a cell in a specific column depending on the value displayed when the table is displayed but i cant find how to do this.

Completed = green background

In Progress = Amber background

Cancelled = Red background


I have tried:

/a679dc7e3f76f8e58cbbe96a84ea4caf

/4857be0dc8ac4fcb1a30446070f72301/b24986c29e827ed6e88b011635b9f9fb

and also using the contains but never works on page load.

If i do it `onclick` i can get it working proving i am not looking for specific value in the list.

How can i do this

Comments (2)

photo
1

Found the correct fix

/76d360eaba50a248faef74ea3d0d0236

I was selecting the DataList column and not the table column.

photo
1

Glad you figured it out!