Default size for dropdownlist

  • Thread starter Thread starter tshad
  • Start date Start date
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
 
have you tried setting the sytle?

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

or something?

Karl
 
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)
 
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.
 
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

Back
Top