0

Consider an ASP.NET server control DropDownList (or <input type='select'>) with a large number of options (e.g. 100 options). When clicking on the list, the full list of 100 options are shown. They're all displayed, and run off the screen.

How can the control's picklist size be resized or limited to the first n options?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
Johnrad
  • 2,637
  • 18
  • 58
  • 98
  • Possible duplicate of [Height of an HTML select box (dropdown)](http://stackoverflow.com/questions/570642/height-of-an-html-select-box-dropdown). Short answer: sorry, you can't do that. – Frédéric Hamidi Dec 17 '10 at 16:55
  • Please refrain from padding your questions with "I'm a noob", or other generalities related to your experience. Just ask the question. Padding your question will make no difference to the answers you recieve. – George Johnston Dec 17 '10 at 16:55

1 Answers1

0

Frédéric Hamidi has already given the short answer, however he has also referred you to a perfect alternative. Explore this and that is similar to what I had done when I faced similar situation.

Idea is that you don't populate your list. This way your drop down will be empty and in place of that you show a div with scrollbar and whatever you wish. Align this div in such a way that user thinks, "it is the dropdown".

Pradeep
  • 3,258
  • 1
  • 23
  • 36