Solved

Limiting the height of a drop down list?

Posted on 2008-09-29
6
336 Views
Last Modified: 2012-06-22
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
Comment
Question by:directxBOB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 20

Expert Comment

by:informaniac
ID: 22595365
Set the ddl1.Items.Capacity

ddl1.Items.Capacity=10;
0
 

Author Comment

by:directxBOB
ID: 22595457
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
 
LVL 20

Assisted Solution

by:informaniac
informaniac earned 125 total points
ID: 22595485
Place a listbox instead and set the rows to 10...
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 22

Assisted Solution

by:prairiedog
prairiedog earned 125 total points
ID: 22597451
Change the Select query of the DDL's data source to limit the total:
SELECT Top 10 * FROM YourTable
0
 

Author Comment

by:directxBOB
ID: 22603804
I am not looking to limit the number of entries in the drop down list, just the scroll height.
0
 
LVL 2

Accepted Solution

by:
Kimpzor earned 250 total points
ID: 22604120
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

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Please explain purpose of GZIP 4 83
How can I do Unit Testing with Session ? 1 41
async questions 5 49
How does GeoJson relates to Leaflet and Mapbox? 4 50
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question