Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    forcing dropdownlist widths

    hello,
    is there any way i can force the width of the dropdownlist so that it doesnt make the drop down field as long as the longest option on the list....this is tottally messing up my layout.


    Any ideas? thanks

  • #2
    Regular Coder
    Join Date
    May 2006
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try:
    Code:
    <asp:DropDownList ID="MyDDL" runat="server" Width="100px" ...

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this doesnt workin in gecko browsers like FF and Opera. Is there another method?

  • #4
    Regular Coder
    Join Date
    May 2006
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you mean forcing the width of the "dropdownlist" or the "select box" ?

    Width="100px" will force the width of the dropdownlist on IE, FF and OP
    Last edited by otaku149; 12-14-2006 at 08:27 PM.

  • #5
    New Coder
    Join Date
    Mar 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im using:

    <ASPropDownList Id="someListDropDownList" Runat="server" Width="150px" />

    In FF and Opera it's still showing the list to be as wide as the longest option on that drop down list. In IE it works just fine.

  • #6
    Regular Coder PremiumBlend's Avatar
    Join Date
    Apr 2006
    Location
    Marion, Iowa
    Posts
    201
    Thanks
    0
    Thanked 13 Times in 13 Posts
    Have you tried:

    Code:
    <asp:DropDownList Id="someListDropDownList" runat="server" style="width: 150px;" />
    My Website: DumpsterDoggy

  • #7
    New Coder
    Join Date
    Mar 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks Premium, that did the trick.

  • #8
    Regular Coder
    Join Date
    May 2006
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok I understand, that's because you are using framework 1.1 and I am using framework 2.0

    This bug has been fix on framework 2.0

    Using Width="100px" will work on FF and Opera with framework 2.0


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •