ComboBox DropDownWidth

  • Thread starter Thread starter Peter Larsen [CPH]
  • Start date Start date
P

Peter Larsen [CPH]

Hi,

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

Thank you in advance.

BR
Peter
 
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)
 
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 <select> element.

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/aspnet/Custom_ASPNET_ComboxBox_Control.as
px

#ComboBox Control for ASP.NET
http://www.codeproject.com/KB/custom-controls/comboboxcontrol.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:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#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/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Peter Larsen [CPH]" <[email protected]>
Subject: ComboBox DropDownWidth
Date: Tue, 30 Sep 2008 15:19:20 +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
 
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 <select> html 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:
(e-mail address removed).

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

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <[email protected]>
 
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
 
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:
(e-mail address removed).

--------------------
From: "Peter Larsen [CPH]" <[email protected]>
References: <[email protected]>
<[email protected]>
 
Back
Top