Rows in datalist in different colors

S

schapopa

Hi,
I want to make some rows in datalist red, based on the resut of the
query.
e.g. my datalist has 10 rows, now I want to have row 3,4,7 in red
because of value = true for row 3,4 and 7 in datatable. Can anyone point
me into some direction?

Thank you
Schapopa
 
G

Guest

schapopa said:
I want to make some rows in datalist red, based on the resut of the
query.
e.g. my datalist has 10 rows, now I want to have row 3,4,7 in red
because of value = true for row 3,4 and 7 in datatable. Can anyone point
me into some direction?

Turn the <TD> tag into a server control (add a runat=server tag). In the
ItemDataBound event write the following:

If Variable = True
e.item.findcontrol("ctlTD").attribute.add("bgColor", "red")
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top