473,387 Members | 1,501 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,387 software developers and data experts.

ComboBox DropDownWidth

Hi,

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

Thank you in advance.

BR
Peter
Sep 30 '08 #1
6 2415
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 <selectelement.

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****@microsoft.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*********@community.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="searchHeadLine"<%-- Fund --%>
<asp:dropdownlist id="fundSearchCombo" runat="server" width="150px"
autopostback="true" OnSelectedIndexChanged="OnFundSearchComboChange">
<asp:ListItem Text="No Selection"></asp:ListItem>
</asp:dropdownlist>
</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****@microsoft.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*********@community.nospam>
References: <eZ**************@TK2MSFTNGP02.phx.gbl>
<uf**************@TK2MSFTNGHUB02.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="searchHeadLine"<%-- Fund --%>
<asp:dropdownlist id="fundSearchCombo" runat="server" width="150px"
autopostback="true" OnSelectedIndexChanged="OnFundSearchComboChange">
<asp:ListItem Text="No Selection"></asp:ListItem>
</asp:dropdownlist>
</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 "DropDownWidth" 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****@microsoft.com.

--------------------
>From: "Peter Larsen [CPH]" <Pe*********@community.nospam>
References: <eZ**************@TK2MSFTNGP02.phx.gbl>
<uf**************@TK2MSFTNGHUB02.phx.gbl>
<OE*************@TK2MSFTNGP06.phx.gbl>
<2G**************@TK2MSFTNGHUB02.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
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...
1
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...
2
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...
1
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...
3
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
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
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...
0
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. ...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.