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

  • Thread starter Thread starter Vincent
  • Start date Start date
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
 
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)
 
Hi, thanks but i get the error::
"property access must assign to the property or use its value"
 
Back
Top