View Full Version : forcing dropdownlist widths

12-14-2006, 06:41 PM
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

12-14-2006, 06:59 PM

<asp:DropDownList ID="MyDDL" runat="server" Width="100px" ...

12-14-2006, 07:07 PM
this doesnt workin in gecko browsers like FF and Opera. Is there another method?

12-14-2006, 08:24 PM
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

12-14-2006, 08:58 PM
im using:

<ASP:DropDownList 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.

12-14-2006, 09:02 PM
Have you tried:

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

12-14-2006, 09:40 PM
thanks Premium, that did the trick.

12-14-2006, 11:34 PM
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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum