Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Dynamically resize a DropDownList in a grid when dropped down

Reply
Thread Tools

Dynamically resize a DropDownList in a grid when dropped down

 
 
Keith-Earl
Guest
Posts: n/a
 
      04-08-2005
Not sure if you can do this, but we would like to dynamically resize the
width of a DDL in a grid when the DDL is dropped down. For example, please
consider this data:

AL - Alabama
AR - Arkansas
FL - Florida
etc.

We want to make our DDL pretty narrow so that it only shows the first two
characters of the string when the DDL is not dropped down. When the user
drops the list down we want to resize it wide enough to show the entire
string.

We essentially want to duplicate the behavior found in many rich client
environments such as MS Access. Access allows us to have multiple columns
in the dropped down portion of the control and only show the first column
when the DDL is not dropped down.

We could also assign a tool tip to the DDL if we could supply a unique tip
to each row in the DDL.

Any ideas?

Many thanks,

Keith


 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      04-13-2005
Hi Keith,

It looks like you could make that work with some inline JavaScript and
Dynamic HTML. Here's a little demo code:

<asp:dropdownlist id="DropDownList1" runat="server" Width="40px"
OnFocus="this.style.width='120px'" OnBlur="this.style.width='40px'">
<asp:listitem Value="AL - Alabama">AL -
Alabama</asp:listitem>
<asp:listitem Value="AR - Arkansas">AR -
Arkansas</asp:listitem>
<asp:listitem Value="FL - Florida">FL -
Florida</asp:listitem>
</asp:dropdownlist>

You might want to look for an event that suits your needs better, other than
OnFocus. The available events are shown here:

http://msdn.microsoft.com/workshop/a...cts/select.asp

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto

"Keith-Earl" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Not sure if you can do this, but we would like to dynamically resize the
> width of a DDL in a grid when the DDL is dropped down. For example,
> please consider this data:
>
> AL - Alabama
> AR - Arkansas
> FL - Florida
> etc.
>
> We want to make our DDL pretty narrow so that it only shows the first two
> characters of the string when the DDL is not dropped down. When the user
> drops the list down we want to resize it wide enough to show the entire
> string.
>
> We essentially want to duplicate the behavior found in many rich client
> environments such as MS Access. Access allows us to have multiple columns
> in the dropped down portion of the control and only show the first column
> when the DDL is not dropped down.
>
> We could also assign a tool tip to the DDL if we could supply a unique tip
> to each row in the DDL.
>
> Any ideas?
>
> Many thanks,
>
> Keith
>


 
Reply With Quote
 
 
 
 
Keith-Earl
Guest
Posts: n/a
 
      04-13-2005
Thanks. Will try very soon.

Keith


"Ken Cox [Microsoft MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Keith,
>
> It looks like you could make that work with some inline JavaScript and
> Dynamic HTML. Here's a little demo code:
>
> <asp:dropdownlist id="DropDownList1" runat="server"
> Width="40px" OnFocus="this.style.width='120px'"
> OnBlur="this.style.width='40px'">
> <asp:listitem Value="AL - Alabama">AL -
> Alabama</asp:listitem>
> <asp:listitem Value="AR - Arkansas">AR -
> Arkansas</asp:listitem>
> <asp:listitem Value="FL - Florida">FL -
> Florida</asp:listitem>
> </asp:dropdownlist>
>
> You might want to look for an event that suits your needs better, other
> than OnFocus. The available events are shown here:
>
> http://msdn.microsoft.com/workshop/a...cts/select.asp
>
> Let us know if this helps?
>
> Ken
> Microsoft MVP [ASP.NET]
> Toronto
>
> "Keith-Earl" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Not sure if you can do this, but we would like to dynamically resize the
>> width of a DDL in a grid when the DDL is dropped down. For example,
>> please consider this data:
>>
>> AL - Alabama
>> AR - Arkansas
>> FL - Florida
>> etc.
>>
>> We want to make our DDL pretty narrow so that it only shows the first two
>> characters of the string when the DDL is not dropped down. When the user
>> drops the list down we want to resize it wide enough to show the entire
>> string.
>>
>> We essentially want to duplicate the behavior found in many rich client
>> environments such as MS Access. Access allows us to have multiple
>> columns in the dropped down portion of the control and only show the
>> first column when the DDL is not dropped down.
>>
>> We could also assign a tool tip to the DDL if we could supply a unique
>> tip to each row in the DDL.
>>
>> Any ideas?
>>
>> Many thanks,
>>
>> Keith
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
I need Help tracking down where packets are being dropped.. Scott Townsend Cisco 3 03-07-2007 11:35 PM
How to resize all images sizes and coordinates of the images on resize browser rams.kakara@gmail.com ASP General 2 02-13-2005 09:03 AM
Dynamically Resize Container of Photo (gif) Guadala Harry ASP .Net 3 11-09-2004 11:19 PM
Dynamically Resize Frames Guadala Harry ASP .Net 1 09-05-2004 09:21 AM



Advertisments