...

View Full Version : forcing dropdownlist widths



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

otaku149
12-14-2006, 07:59 PM
try:


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

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

otaku149
12-14-2006, 09: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

bugster
12-14-2006, 09: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.

PremiumBlend
12-14-2006, 10:02 PM
Have you tried:


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

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

otaku149
12-15-2006, 12:34 AM
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