Text alignment in DropDownList

Discussion in 'ASP .Net Web Controls' started by Russ, Jul 12, 2004.

  1. Russ

    Russ Guest

    I'm trying to figure out how to cause the items in a DropDownList to
    be right justified. This is a dynamically created list. Here is what
    I have tried:

    DropDownList List = new DropDownList ();
    List.Style.Add ("Position", "Absolute");
    List.Style.Add ("Left", "10px");
    List.Style.Add ("Top", "320px");
    List.Style.Add ("text-align", "right");

    This does not work. I found some info that there is a bug in the
    framework that causes this failure and to use the following instead:

    List.DataSource = TextArray;
    DedList.DataBind ();
    foreach (ListItem item in List.Items)
    {
    item.Attributes.Add ("style", "text-align:right");
    }

    This does not work either. Can anyone tell me what to do?

    Thanks, Russ
     
    Russ, Jul 12, 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. tshad

    Checkbox text alignment

    tshad, Mar 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    533
    tshad
    Mar 7, 2005
  2. =?Utf-8?B?QmFobWFu?=

    Checkbox Text Alignment

    =?Utf-8?B?QmFobWFu?=, Feb 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,611
    =?Utf-8?B?QmFobWFu?=
    Feb 9, 2006
  3. FluxForums

    Text Alignment

    FluxForums, Feb 22, 2004, in forum: HTML
    Replies:
    29
    Views:
    1,001
    SpaceGirl
    Feb 23, 2004
  4. Pete
    Replies:
    6
    Views:
    1,088
    Inger Helene Falch-Jacobsen
    Mar 5, 2004
  5. Karsten Wutzke

    Text field text alignment

    Karsten Wutzke, Dec 14, 2006, in forum: HTML
    Replies:
    5
    Views:
    870
    Jonathan N. Little
    Dec 14, 2006
Loading...

Share This Page