Default size for dropdownlist

T

tshad

Is there a way to set the Default size of a DropDownList?

If there is nothing to fill it with you get a really small (width) control
that looks kind of funny. I wanted to set it to be abou 50px if there is
nothing in the box. Width doesn't seem to work.

Thanks,

Tom
 
K

Karl Seguin

have you tried setting the sytle?

dropdownList.Styles.Add("width", "200px");

or something?

Karl
 
B

Bruce Barker

the downside of using a style, is it fixes the width, so it better be width
enough to display the dropdown values once added. you can use a style width
only when there are no entries to get around this.

-- bruce (sqlwork.com)
 
G

Guest

To resolve this problem pepole usually add one default entry text to the
Dropdown box like "Add the Items". dont know if that trick works for you also.

Hope this helps.
 
T

tshad

Hitesh said:
To resolve this problem pepole usually add one default entry text to the
Dropdown box like "Add the Items". dont know if that trick works for you
also.

Hope this helps.

Both solutions would work.

I can always add the style when empty and when not, take it out.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,824
Members
47,370
Latest member
desertedtyro29

Latest Threads

Top