Limiting the height of a drop down list?

I have a drop down list with over 1000 items. How do I limit it so that it would only show 10 or 20 of the items? Intead of as many items as the screenspace will allow?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

KimpzorConnect With a Mentor Commented:
ASP.NET ddl does not have MaxDropDownItems property as win forms ddl do. I think you would have to build a custom  control with some javascript that loops out a drop down list. Also check a few tutorials about client script callbacks
Obadiah ChristopherCommented:
Set the ddl1.Items.Capacity

directxBOBAuthor Commented:
ddl1.Items.Capacity is the number of items that a DDL can store. What I am looking for is a way to limit the number shown, that the when you select the drop down it doesn't try to show all that the screenspace allows.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Obadiah ChristopherConnect With a Mentor Commented:
Place a listbox instead and set the rows to 10...
prairiedogConnect With a Mentor Commented:
Change the Select query of the DDL's data source to limit the total:
SELECT Top 10 * FROM YourTable
directxBOBAuthor Commented:
I am not looking to limit the number of entries in the drop down list, just the scroll height.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.