473,770 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox DropDownWidth

Hi,

How do i set DropDownWith in a asp.net ComboBox ??

Thank you in advance.

BR
Peter
Sep 30 '08 #1
6 2436
this is no combobox in asp.net. i assume you mean the dropdown
(<select>). the width of the control is set with the style width
com,mand like any other dom object. if you mean the width of the actual
dropdown, this is not settable with most browsers.

if you need this feature you will need an dom/javascript based control.
there are a lot of samples, but you need to determine what features you
need. most are pretty weak on keyboard support, so be sure to check that.

-- bruce (sqlwork.com)

Peter Larsen [CPH] wrote:
Hi,

How do i set DropDownWith in a asp.net ComboBox ??

Thank you in advance.

BR
Peter

Sep 30 '08 #2
Hi Peter,

As bruce suggested, the ASP.NET built-in control only support a
dropdownlist or ListBox, no combox control. Also, for dropdownlist and
listbox, they're based on the pure HTML <selectelemen t.

If you need a combobox, you can have a look at some community member's
custom control which may provide some more customizable propeties (since
those controls are built via custom html elements ):

#ASP.NET ComboBox
http://dotnetslackers.com/articles/a...Box_Control.as
px

#ComboBox Control for ASP.NET
http://www.codeproject.com/KB/custom...oxcontrol.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Peter Larsen [CPH]" <Pe*********@co mmunity.nospam>
Subject: ComboBox DropDownWidth
Date: Tue, 30 Sep 2008 15:19:20 +0200
>Hi,

How do i set DropDownWith in a asp.net ComboBox ??

Thank you in advance.

BR
Peter
Oct 1 '08 #3
Hi Steven and Bruce,

Thanks for you comments.

This is the code:

<td class="searchHe adLine"<%-- Fund --%>
<asp:dropdownli st id="fundSearchC ombo" runat="server" width="150px"
autopostback="t rue" OnSelectedIndex Changed="OnFund SearchComboChan ge">
<asp:ListItem Text="No Selection"></asp:ListItem>
</asp:dropdownlis t>
</td>

I don't need to be able to set the dropdown width manually. I just want the
combobox to asjust the width automatically on dropdown - just like what
Firefox do.
Using Internet Explorer, the dropdown box is the same width as the combobox.

Why is it possible with firefox, but not with IE ??

BR
Peter
Oct 1 '08 #4
Thanks for your reply Peter,

I've got the things you mentioned. I'm afraid this width behavior is fixed
by the dropdownlist (html <select>) component of IE browser. The IE browser
use the window standard dropdownlist for rendering <selecthtml element on
web page. I think FireFox use its own implementation which is different
from IE. And this behavior is not controlled by standard css or html
attribute.

But it is really a good idea to improve the dropdown control in IE. You're
welcome to post you feedback to the new opening IE connect feedback site:

http://connect.microsoft.com/IE

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Peter Larsen [CPH]" <Pe*********@co mmunity.nospam>
References: <eZ************ **@TK2MSFTNGP02 .phx.gbl>
<uf************ **@TK2MSFTNGHUB 02.phx.gbl>
>Subject: Re: ComboBox DropDownWidth
Date: Wed, 1 Oct 2008 13:47:35 +0200
>
Hi Steven and Bruce,

Thanks for you comments.

This is the code:

<td class="searchHe adLine"<%-- Fund --%>
<asp:dropdownli st id="fundSearchC ombo" runat="server" width="150px"
autopostback=" true" OnSelectedIndex Changed="OnFund SearchComboChan ge">
<asp:ListItem Text="No Selection"></asp:ListItem>
</asp:dropdownlis t>
</td>

I don't need to be able to set the dropdown width manually. I just want
the
>combobox to asjust the width automatically on dropdown - just like what
Firefox do.
Using Internet Explorer, the dropdown box is the same width as the
combobox.
>
Why is it possible with firefox, but not with IE ??

BR
Peter
Oct 3 '08 #5
Hej Steven,

Thanks for your reply.
Isn't DropDownWidth a standard property ??
Anyway, i think i'll post a comment at microsoft about IE - and look for a
custom control.

BR
Peter
Oct 3 '08 #6
Thanks Peter,

So far "DropDownWi dth" property is still not supported on IE.
Appreciate your feedback.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

--------------------
>From: "Peter Larsen [CPH]" <Pe*********@co mmunity.nospam>
References: <eZ************ **@TK2MSFTNGP02 .phx.gbl>
<uf************ **@TK2MSFTNGHUB 02.phx.gbl>
<OE************ *@TK2MSFTNGP06. phx.gbl>
<2G************ **@TK2MSFTNGHUB 02.phx.gbl>
>Subject: Re: ComboBox DropDownWidth
Date: Fri, 3 Oct 2008 15:03:55 +0200
>Hej Steven,

Thanks for your reply.
Isn't DropDownWidth a standard property ??
Anyway, i think i'll post a comment at microsoft about IE - and look for a
custom control.

BR
Peter
Oct 7 '08 #7

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

Similar topics

3
3030
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can download a fully working C# sample with the Northwind.mdb here: www.insightgis.com.au/web/stuff/DataGridCombo.zip
1
1224
by: jack | last post by:
I drew a combobox in a form. Because some reason,the combobox 's width must be 50,but the combobox's content 's length is larger(for example: "000001 tks company"),so some content can't show,how do I do,plz help me!!! In the microsoft's access ,the combobox can show the all content.
2
4333
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know how to use this code? please help! http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20862953.html
1
2330
by: genojoe | last post by:
I want to right-align numbers in a combobox. Since there is no TextAlign property for the ComboBox, I tried the following code in a form containing a default combobox. 'Declarations and two subs. Dim miarr() As Long = {200000000000333, 33} Dim moGraphics As Graphics = Me.CreateGraphics Dim msngWidth As Single = 120 Private Sub MyForm_Load(ByVal sender As Object, ByVal e As
3
2230
by: BrianDH | last post by:
Hi Is there a way to have the view/display width different from the width as it sits on the form?
3
3958
by: BrianDH | last post by:
Hi Is there a way to have the view/display width different from the width as it sits on the form? Thanks Brian
1
4478
by: stinehelferw | last post by:
I need a right-click menu on a form list control with combobox controls. I used View->Toolbars->Customize to create a toolbar. I added ComboBox through commands tab. I set properties to Popup making it a shortcut menu. I have no problem linking it to the list control. The menu comes up when I right-click the list control.
0
1474
by: =?Utf-8?B?QnJpYW4gS2l0dA==?= | last post by:
I wrote a class that inherits ComboBox to create a dropdown that contains both an image and a text description. This is for an IE browser toolbar. I use the OwnerDrawFixed method to do this. The first time click the arrow for the drop down, and shows an empty dropdown, and immediately closes it. The second time I click the arrow, it works perfectly. It does this same behavior on Vista, XP, IE6 and IE7. I'm stumped, I'm sure there...
1
3127
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
Hi, In a C#.Net2.0 Winforms application I have some combo boxes. I ind these boxes to enum values and then call ComboBox.Size = ComboBox.PreferredSize: But, the combo box is never wide enough to display long items! Isn't that what PreferredSize is uspposed to give? Am I missing something or is there another way to make sure that my comboboxes are wide enough to display all the text in them? Thanks!
0
9619
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
9454
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,...
0
10260
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
10038
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
8933
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
7460
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
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2850
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.