DropDownList width in Internet Explorer
I have an ASP.NET DropDownList with a fairly wide content, while the width of the closed list needs to be quite small due to site space constraints. This is why I need to be able to set a specific width on the list when it is closed, but I need it to be as wide as the content when it is opened.
By default, Firefox automatically makes DropDownLists as wide as its contents when opened. On the other hand, Internet Explorer does not.
Can IE be told to open an open DDL as wide as the content when it is opened, but smaller when closed? Preferably without using javascript.
EDIT: Ok, I wasn't clear enough in my first post. The emphasis is on opening. I want a certain width in the list to close, but I want it to be as wide as the content when opened. As I said, Firefox does this, IE doesn't.
a source to share
I would recommend not to use a dropdown but a more javascript friendly one like this
http://jquery.sanchezsalvador.com/samples/example.htm
This will allow your content to expand after choosing the width.
a source to share
IE is width up to content by default.
Install CSSClass and give it the specified width and you can change it.
You can also go
select{
width:42px;
}
edit : from what you are now saying, it seems to me that you need to do some javascript because IE won't handle it. Try looking into jquery
a source to share