473,320 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DropDownList changing the width

Hi,
I have a drop down list and have set it's width to 200px.
But sometimes the text in the drop down list exceeds the 200px. This
cuts off the text thus the user cannot see the full description in the
text box. Is there any setting that will allow me to put it to default
to 200px if the text is smaller than 200px else to have it to use the
200px width?
Thanks
Garth
ga*************@cpt.softwarefutures.com
Nov 18 '05 #1
2 2073
The only way around this is writing some really useless scripts that test for
the length of the strings in each option of the select and then calculates
some width. This is overkill for something so mundane as a select.

Best bet and easiest solution is to make the width just wide enough to
display the full text. Otherwise, use a radio list instead.

This is NOT an ASP.Net question...I dunno why you would even think to post
it here....

"Garth" wrote:
Hi,
I have a drop down list and have set it's width to 200px.
But sometimes the text in the drop down list exceeds the 200px. This
cuts off the text thus the user cannot see the full description in the
text box. Is there any setting that will allow me to put it to default
to 200px if the text is smaller than 200px else to have it to use the
200px width?
Thanks
Garth
ga*************@cpt.softwarefutures.com

Nov 18 '05 #2
there is no way to do this. you really should not set a width for a
dropdown. while 200px may look ok on your machine, your clients may be using
different font sizes/ resolutions and see even less. the browser does not
support determine the text size of dropdown strings.

-- bruce (sqlwork.com)
"Charles Chen" <Ch*********@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
| The only way around this is writing some really useless scripts that test
for
| the length of the strings in each option of the select and then calculates
| some width. This is overkill for something so mundane as a select.
|
| Best bet and easiest solution is to make the width just wide enough to
| display the full text. Otherwise, use a radio list instead.
|
| This is NOT an ASP.Net question...I dunno why you would even think to post
| it here....
|
| "Garth" wrote:
|
| > Hi,
| > I have a drop down list and have set it's width to 200px.
| > But sometimes the text in the drop down list exceeds the 200px. This
| > cuts off the text thus the user cannot see the full description in the
| > text box. Is there any setting that will allow me to put it to default
| > to 200px if the text is smaller than 200px else to have it to use the
| > 200px width?
| >
| >
| > Thanks
| > Garth
| > ga*************@cpt.softwarefutures.com
| >
Nov 18 '05 #3

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

Similar topics

2
by: jason | last post by:
Pardon my ignorance on this. The below code works, except, when I edit a record and update the two drop downs take the first entry in the dropdownlist if not selected. I'd also like the dropdown to...
0
by: Luis Esteban Valencia | last post by:
Hello. I have a datagrid with one row. I have a button that adds a new row. I am trying to implement that when the user selects one product it must change the price on the quantity column. Anyway...
1
by: Frank | last post by:
Hello, I have some text boxes and 2 drop down lists (DDL) within a panel like so: Everything updates fine but the values from the DDLs are always the items selected by default. In other words,...
5
by: Victorious1 | last post by:
Why doesn't the the SelectedIndexchanged event for my dropdownlist ever get executed? Why do I get a page not found error when I select a new item? My dropdownlist is within a form. The items...
1
by: Eugene Anthony | last post by:
ModifyUserRegistration.aspx --------------------------- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ModifyUserRegistration.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC...
0
by: sgtmarcjones | last post by:
How do I access a dropdownlist that is nested within a Formview ItemTemplate Gridview Template? I want to see a label (lgbTimeKeep ! TextValue of ddlName dropdownlist) instead of a dropdownlist...
2
by: sree reddy | last post by:
..cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
0
by: asmx126453 | last post by:
Hey mensen I am having some big troubles here i tryd solving it myself with internet for 2 days but i kind fix it. Its about this i have a DotNet project that alrydi is online and working for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.