• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

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?
0
directxBOB
Asked:
directxBOB
3 Solutions
 
informaniacCommented:
Set the ddl1.Items.Capacity

ddl1.Items.Capacity=10;
0
 
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.
0
 
informaniacCommented:
Place a listbox instead and set the rows to 10...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
prairiedogCommented:
Change the Select query of the DDL's data source to limit the total:
SELECT Top 10 * FROM YourTable
0
 
directxBOBAuthor Commented:
I am not looking to limit the number of entries in the drop down list, just the scroll height.
0
 
KimpzorCommented:
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now