473,653 Members | 2,968 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Limit Nbr of items in asp:DropDownLis t?

How can I limit the number of items that show up in a dropdown list at one
time? I have a list of states, and because my dropdown list is near the
bottom of the page, it becomes a drop-up list. It would look a lot more
professional if it only had 20 items at a time, and dropped down normally. I
can't find a way to do this. Can anyone help?

Here's my dropdown list code:
<asp:DropDownLi st ID="ddState" Runat="Server"> </asp:DropDownLis t>

and then it's data-bound in the code-behind.

Any help is appreciated! Thanks!
Feb 22 '06 #1
0 1554

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3208
by: Ganesh Kolappan via .NET 247 | last post by:
Hi I am trying to populate a <asp:dropdownlist> in a XSLT file withdatasource pointing to a C# codebehind file method which returnsa dataview. I am using XSLT extension object. But I am getting"The 'DataSource' property is set only by the runtime. It cannotbe declared." error code: <?xml version="1.0"?> <xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:MyObj="urn:ProductInfo" xmlns:asp="remove">...
1
342
by: Marius | last post by:
Hi all, I need an asp:dropdownlist on a webform that is databound to a dataset. This works fine and returns the data to populate my dropdownlist. In the DB I only have valid data, but I need a option like "< Select a Region>" to be displayd as teh selected value. Currently it displays the first value of the returned dataset. I cannot seem to get this right, below is my code:
1
2465
by: Harry | last post by:
Hi, Just seeing if anyone can help me with a problem I am having with drop down lists. - I have a asp:dropdownlist that gets its values from a database. - The user then selects a value then presses the submit button. - The submit button then calls a function that sets a asp:lable to that value selected. - PROBLEM: No matter what value the user selects, the asp:lable always
7
2032
by: Lastie | last post by:
Hi all, I’ve got a ‘dropdownlist’ web control and I can add ‘listitem’ no problem. I can also bind data from an SQL database fine. My problem is that I want to do both at the same time to allow me to have the first option in the list a ‘listitem’ saying something like ‘please pick an option’, and then the rest of options coming from the database. <asp:dropdownlist id="fm_Category" runat="server"...
1
1455
by: Xuanly ly via .NET 247 | last post by:
asp:dropdownlist always display infront of everything and I can't make it display behind HELP HELP help!!!. <form id="Form1" method="post" runat="server"> <asp:TextBox id="TextBox1" runat="server" style="Z-INDEX: 1; LEFT: 50px; POSITION: absolute; TOP: 300px" Width="250px"></asp:TextBox> <asp:panel id="pnCal runat="server" Width="156px" Height="128px" style=" LEFT: 50px; POSITION: absolute; TOP: 300px"> <asp:Calendar id="Calendar1"...
2
4722
by: HH | last post by:
Hi, I have a dropdown list that is datafilled via a SQL table. The text part is always unique. (A list of countries) Each country is assigned one of three numbers. (This being the 'value' of the ddl.) ie: Country Value Australia 1
1
1557
by: Miguel Dias Moura | last post by:
Hello, I have two questions concerning Asp:DropDownList 1. How to fill a DropDownList from runtime and set its default item? 2. How do use a DropDownList in each datagrid record? All dropdownlist should be filled with the values in field NAME from the same dataset used in the datagrid. The default value of each dropdownlist should be the value of NAME by
2
1317
by: jeffmagill | last post by:
Ive stumbled into one of those infamous problems where something stopped working for apparently no reason - in this case MyDropDownList.SelectedItem.Value. Im not sure exactly which group this should be posted in either so Im just trying general. I have an asp:dropdownlist in a form that is loaded with records from a database. Upon clicking a button, a subroutine SubmitHandler is called. The problem is that no matter which entry in the...
2
1980
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server" Text='<%# Container.DataItem("SM") %>'> </asp:Label> </ItemTemplate>
0
8370
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.