Thursday, March 29, 2012

Set colour of the text in DropDownList?

Hi, how can i set the text colour for each Item in a DropDownList during runtime?Simple CSS. You'd use... for example

<option style="background-color:black;">blah</option>

Of course in your codebehind, since you'll be using ListItems, do this to the listitem.

ListItem.Attributes.Add("style","background-color:black;");
Simple CSS. You'd use... for example

<option style="background-color:black;">blah</option>

Of course in your codebehind, since you'll be using ListItems, do this to the listitem.

ListItem.Attributes.Add("style","background-color:black;");
Thanks for the solution!!!
Add Resolved, dude.

0 comments:

Post a Comment