Coloring the DropDownList
Today I came upon a request about coloring the Dropdownlist list items with different colors. I found that it could not be done as the
I found from the web that we can do this by adding an attribute to it.
iterate through the listitems and then add the Style atrribute
For i = 0 To ddl.Items.Count - 1
ddl.Items(i).Attributes.Add("style", "color:#cccccc")
Next

1 Comments:
I found that I cannot change the font family using this style attribute. It is applicable only for htmlselect controls.
Post a Comment
<< Home