Format Font Color in DropDownList



How do you programmatically set the color of individual list items in a dropdownlist using VB.NET? I have a bound dropdownlist on a web form with about 40 items and there our certain items in the list that need to be a different color. I've tried several things but nothing seems to work. This code snippet works with the HTMLSelect control but not the asp dropdownlist.

ddl.Items(1).Attributes.CssStyle.Item("color") = "Red"

Any input would be greatly appreciated. Thanks.


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