473,698 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dropdownlist: handling very wide listitems

I am populating a dropdownlist via a databind to a database. However, the
text to be displayed can be very long, making the dropdownlist very wide. I
need some way to reduce the width of the dropdownlist but still show the
entire text of the listitem option.

Observations:
1. Setting the dropdownlist to a fixed width chops off the option text to
the width of the control (making long text invisible).
2. Listitem elements are plain text only and do not render any HTML tags.
3. The listitem class is sealed/notInheritable, so making a special listitem
class appears not to be an option.

Ideally, the dropdownlist listitem would be able to wrap the text within a
fixed width field, while still acting as a single unit for selection
purposes.

Another possibility which appears to be impossible is to manually truncate
the long option to a fixed number of characters and then use a tooltip to
show the full text. Listitems don't support tooltips, however.

Does anyone have any ideas on how to deal with this?
Nov 19 '05 #1
1 3553
It appears I could use a specialty control, such as EasyListBox

http://easylistbox.com/demoCustomized.aspx

Still, it would be preferred to do this without a special control.
Nov 19 '05 #2

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

Similar topics

2
9690
by: DesignerX | last post by:
I am being sent an ArrayList of ListItems. I can bind to a dropdownlist control using: oDropDownList.DataSource = oArrayList This works but when the dropdownlist is rendered both the select box value and the text are the same (The ListItem.Text), How do I get the ListItem.Text to render as the text and the ListItem.Value to be the html select option 'value'?
4
1622
by: Luis Esteban Valencia | last post by:
Hi Everyone, How do you get two or more listitems to have the same value? I am trying to do this: <asp:dropdownlist id="one" runat="server"> <asp:listitem text="hello" value="hi" />
1
2598
by: Jeff | last post by:
Hi - I'm creating a web control library (using VB.NET), and I'm trying to add a modified asp:dropdownlist control to it. How do I add asp:ListItems to the dropdownlist (within the web control library control)? My code follows below (and it doesn't work). When I add the control to an aspx page, I simply get a string of the concatenated values ("First
1
2092
by: Geoffrey van den Ouden | last post by:
I'm converting this project from ASP.NET 1.1 to 2.0, and the thing I came across is that my dropdownlist no returns the content of the Value property in a correct way. I'm not using a direct Database connection or anything, most of my dropdownlists are filled with values from static singletons that are running or just some code that is generated at page_load. The basic thing is that on page_load I always create a ListItemCollection...
0
1629
by: Jose Fernandez | last post by:
Hello First of all, excuse my english We all know that in a normal page with codebehind we add a dropdownlist control and we bind() it in the (!ISPOSTBACK), so, we don't need to go to database again 'cause its value are saved (i assume viewstate). Well. I have a class that inherits from WebControl and INamingContainer. This class Load an ASCX control (that contains other controls in itself like textbox and Dropdownlist). In the...
1
7229
by: Jason Wilson | last post by:
I have two dropdownlists that are bound to the same datasource and I have a couple of questions: 1) Because they are bound to the same datasource, I am assuming that they only make 1 round trip to the DB server -- is that correct? 2) On a user's click of a button, one of the actions in the button OnClick event is to set the selectedindex of the 2nd DDL to that of the 1st. I get a runtime error here that says that the given index is...
5
5401
by: Mark Rae | last post by:
Hi, Here's one just for my own interest - I know how to add ListItems programatically, and how to concatenate fields in SQL queries... But, is there any way to specify anything other than a single database field in the DataTextField of a DropDownList? E.g. let's say I have the following SQL Server table called MyUsers:
0
233
by: Radu | last post by:
I have a global resource, Scorecards.resx. For stuff like <asp:CustomValidator id="validDate" Text="*" ErrorMessage= "<%$ Resources:Scorecards, String66 %>" Display="Dynamic" OnServerValidate="ServerValidate" runat="server">
1
1639
by: Nathan Sokalski | last post by:
I am creating a control in which I inherit from the DropDownList. The only method that I override is RenderContents. Here is my basic code: Public Class StatesDropDownList : Inherits DropDownList Protected Overrides Sub RenderContents(ByVal writer As System.Web.UI.HtmlTextWriter) 'I add several items to the Items property here using Me.Items.Add() MyBase.RenderContents(writer) End Sub
0
8680
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
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8899
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
7738
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
6528
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
5861
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
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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
3
2007
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.