Change Forecolor of first Item of dropdown

53 views Asked by At

I have a dropdown where I need to set the forecolor of the first item to some color. I tried the following script, but does not work.

dropdown.DataSource =.....
dropdown.DataBind();
ListItem li = new ListItem();
li.Text = "Feedback Type";
li.Value = string.Empty;
li.Attributes.Add("style", "Color: Red");
dropdown.Items.Insert(0, li);

Any help appreciated. Thanks

0

There are 0 answers