Welcome Guest Search | Active Topics | Sign In | Register

DropDownList in DropDownTemplate in ComboBox control Options
Abacus Financial Inc.
Posted: Sunday, June 10, 2012 5:38:04 PM
Rank: Member
Groups: Member

Joined: 11/26/2010
Posts: 26
Hi,

Sorry if I missed this in the documentation or in the forum topics: is putting asp .net DropDownList control inside the DropDownTemplate of ComboBox supported?
The control renders, but I cannot choose any items - I guess the dropdown of that DropDownList somehow interferes with the DropDownTemplate? How can I make this work?

Thanks in advance!
eo_support
Posted: Sunday, June 10, 2012 9:01:30 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You can put anything inside the DropDownTemplate of a ComboBox control, but you have to call this function to notify the ComboBox of the new value:

http://www.essentialobjects.com/doc/1/jsdoc.public.global.eo_setcomboboxvalue.aspx

The only exception to this rule is if you put a EO.Web ListBox control in it. An EO.Web ListBox knows EO.Web ComboBox so it will automatically call the above function for you.

Thanks!
Abacus Financial Inc.
Posted: Monday, June 11, 2012 1:32:12 AM
Rank: Member
Groups: Member

Joined: 11/26/2010
Posts: 26
Not sure if I understand. For every value of of the DropDownList in the template, I have to call this function? Could you post some sample code that will correctly put a DDL inside the DDTemplate with, let's say, 2 static values?

Thank you!
eo_support
Posted: Monday, June 11, 2012 8:48:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Try to think the ComboBox as JUST a simple TextBox. The rule is wheneer you want to update the TextBox, you update it. How many values you have in your DropDownList, or whether you use a DropDownList at all is irrelevant.

Here is a working example. You can take a look of the source code of the sample to see how it works.

http://demo.essentialobjects.com/Demos/ComboBox/Features/Drop%20Down%20Template%20-%20Advanced/Demo.aspx

Thanks!
Abacus Financial Inc.
Posted: Monday, June 11, 2012 2:48:19 PM
Rank: Member
Groups: Member

Joined: 11/26/2010
Posts: 26
I'm not explaining myself well at all :) I get the idea of retrieving the value from the DropDownTemplate from a control to the "text" area of the combox, but it's not my issue. I can't get past the simple stuff here:

<eo:ComboBox ID="ComboBox1" runat="server" Width="150px" ControlSkinID="None"
DefaultIcon="00101070" HintText="Type here">

<DropDownTemplate>

Some text
<br/>

<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Item1</asp:ListItem>
<asp:ListItem>Item2</asp:ListItem>
</asp:DropDownList>

</DropDownTemplate>

<IconAreaStyle CssText="font-family: tahoma; font-size: 12px; border-left: solid 1px #a8b1c6; border-top: solid 1px #a8b1c6; border-bottom: solid 1px #a8b1c6; vertical-align:middle;padding-left:2px; padding-right:2px;" />
<IconAreaHoverStyle CssText="font-family: tahoma; font-size: 12px; border-left: solid 1px #0a246a; border-top: solid 1px #0a246a; border-bottom: solid 1px #0a246a; vertical-align:middle;padding-left:2px; padding-right:2px;" />
<HintTextStyle CssText="font-style:italic;background-color:#c0c0c0;color:white;line-height:15px;" />
<TextAreaStyle CssText="font-family: tahoma; font-size: 12px; border-top: solid 1px #a8b1c6; border-bottom: solid 1px #a8b1c6; vertical-align:middle;padding-left:2px; padding-right:2px;" />
<TextAreaHoverStyle CssText="font-family: tahoma; font-size: 12px; border-top: solid 1px #0a246a; border-bottom: solid 1px #0a246a; vertical-align:middle;padding-left:2px; padding-right:2px;" />
<IconStyle CssText="width:16px;height:16px;" />
<ButtonAreaStyle CssText="border: solid 1px #a8b1c6; vertical-align:middle;" />
<ButtonAreaHoverStyle CssText="border: solid 1px #0a246a; vertical-align:middle;" />
<ButtonStyle CssText="width:14px;height:18px;background-color:#dee1e7; background-image:url(00020012); background-position: center center; background-repeat: no-repeat;" />
<ButtonHoverStyle CssText="width:14px;height:18px;background-color:#b6bdd2; background-image:url(00020012); background-position: center center; background-repeat: no-repeat;" />
</eo:ComboBox>

I'm not able to select "Item2" at all.

Sorry, I should've posted code earlier.
eo_support
Posted: Monday, June 11, 2012 2:55:21 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Abacus Financial Inc. wrote:
I'm not explaining myself well at all :) I get the idea of retrieving the value from the DropDownTemplate from a control to the "text" area of the combox, but it's not my issue.


This is in fact exactly your issue. You need to figure out these following:

1. How to handle a "select" event from your own drop down UI on the client side with JavaScript (in this case it would be your DropDownList);
2. How to get your current selected value from your own drop down UI in your event handler;

Once you got those two working, you can just pass the value to our ComboBox. We do not provide support on these two issues because we consider them generic ASP.NET programming question ---- just replace our ComboBox with a simple textbox and you would have exactly the same question (and solution). As such from our point view, we only tell you how to pass the value to our ComboBox, not how to get the current selected value from your own custom UI.

I also do not understand why you want to put a DropDownList inside a ComboBox's drop down. That seems to be redudant to me as you will have two levels of drop downs.

Thanks!
Abacus Financial Inc.
Posted: Monday, June 11, 2012 5:23:05 PM
Rank: Member
Groups: Member

Joined: 11/26/2010
Posts: 26
You're digging too deep, I'm stuck on the trivial stuff. That little down arrow on the generic DropDownList control that lets you EXPAND and see all the items (before you even click and select them) - I'm not able to click on that. Try the code I've posted.

As far as having two dropdown lists, I like the flexibility of ComboBox and I'm building a pretty complex dropdown panel with checkboxes, radiobuttons and dropdowns...so far the only control I'm having difficulty with is DropDownList
Abacus Financial Inc.
Posted: Monday, June 11, 2012 7:53:10 PM
Rank: Member
Groups: Member

Joined: 11/26/2010
Posts: 26
Upgraded 2011 to the latest 2012 build - problem solved. Thank you for your time!
Abacus Financial Inc.
Posted: Monday, June 11, 2012 7:59:47 PM
Rank: Member
Groups: Member

Joined: 11/26/2010
Posts: 26
Sorry, spoke too soon: Chrome and FF 13 are fine; IE 9 still has the same issue
eo_support
Posted: Monday, June 11, 2012 10:55:19 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

We have confirmed this is a bug and posted a new build that should fix this problem. Please see your private message for the download location.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.