Format Font Color in DropDownList

Discussion in 'ASP .Net Web Controls' started by Kurgen, Jun 10, 2004.

  1. Kurgen

    Kurgen Guest

    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.
     
    Kurgen, Jun 10, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UmVraGE=?=
    Replies:
    7
    Views:
    3,274
    Eswar
    Mar 26, 2007
  2. Brian McCullough

    DropdownList.Enabled = False and Font Color?

    Brian McCullough, Jun 12, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    2,454
    Brian McCullough
    Jun 12, 2007
  3. mttc
    Replies:
    2
    Views:
    2,402
    Roedy Green
    Jul 3, 2009
  4. Tim Ebert

    Format Font Color in DropDownList

    Tim Ebert, Jun 10, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    138
    Tim Ebert
    Jun 10, 2004
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    427
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page