Format Font Color in DropDownList

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

  1. Tim Ebert

    Tim Ebert 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.
     
    Tim Ebert, Jun 10, 2004
    #1
    1. Advertisements

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. Karl Hungus

    Font class, external font files question

    Karl Hungus, Feb 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    739
    Karl Hungus
    Feb 4, 2004
  2. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    903
    Matt Berther
    Feb 20, 2005
  3. Michael Glavitsch
    Replies:
    1
    Views:
    965
    Roedy Green
    Jul 15, 2003
  4. =?Utf-8?B?UmVraGE=?=
    Replies:
    7
    Views:
    3,617
    Eswar
    Mar 26, 2007
  5. Brian McCullough

    DropdownList.Enabled = False and Font Color?

    Brian McCullough, Jun 12, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    2,691
    Brian McCullough
    Jun 12, 2007
  6. mttc
    Replies:
    2
    Views:
    2,694
    Roedy Green
    Jul 3, 2009
  7. Kurgen

    Format Font Color in DropDownList

    Kurgen, Jun 10, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    397
    Kurgen
    Jun 10, 2004
  8. Kamaljeet Saini
    Replies:
    0
    Views:
    879
    Kamaljeet Saini
    Feb 13, 2009
Loading...