Solved

Limiting the height of a drop down list?

Posted on 2008-09-29
6
338 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 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