how to apply forecolor to listitem of dropdownlist in function of some values?

V

Vincent

Hi,

i would like to have a forecolor for each listitem with some values only of
the dropdownlist:

If i=5 ot i=10 or i=15 then apply red forecolor to those listitems otherwise
no color.

For i = 1 To 20
z = New ListItem("item" & i, i)
DropDownList1.Items.Add(z)
??
next

Thanks
Vincent
 
B

bruce barker

For i = 1 To 20
z = New ListItem("item" & i, i)
If i=5 ot i=10 or i=15 then z.Attributes("style","color:red")
DropDownList1.Items.Add(z)
next

-- bruce (sqlwork.com)
 
V

Vincent

Hi, thanks but i get the error::
"property access must assign to the property or use its value"
 

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

Top