This is a migrated thread and some comments may be shown as answers.

Checked Drop Down menu stays open in aspx, closes in ascx

3 Answers 70 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Blair
Top achievements
Rank 1
Blair asked on 29 Jul 2013, 06:15 PM
I have two RadComboBoxes - one in the main page, one in a user control.  They are identical in all ways other than data source and location. They both have multi-checkboxes enabled.

When I expand the ASPX Drop Down menu and check an item, the control does a postback as expected and remains open to allow another item to be checked.  

When I expand the ASCX Drop Down menu and check an item, the control does a postback as expected and closes the Drop Down menu.  This is undesirable behaviour and I would like it to function as the ASPX control does above.

There are no RadAjaxManager calls here (I use empty UpdatePanels to keep the data updated without causing screen refreshes).  

Any help?

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 01 Aug 2013, 03:15 PM
Hello,

Thank you for contacting Telerik Support.

I am afraid that I am not able to replicate the described issue. I am attaching a sample project implementing scenario very similar to yours. Could you please try to replicate the issue with that project and explain what exactly is different in your scenario or where is your update panel?


Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Blair
Top achievements
Rank 1
answered on 01 Aug 2013, 03:59 PM
In having to recreate the bug from scratch I discovered the source of the problem - a parent update panel.  In your solution, wrapping an UpdatePanel ContentTemplate around the RadComboBox causes the combobox to close after the postback.  How can I prevent this from occurring?

My code is below. I have a checkbox that enables or disables the contents of one update panel.  The radcombobox has a single option that when selected enables a free text field.    

<!--Checkbox enables or disables controls in UpdatePanel2 -->
    <asp:CheckBox ID="SharedCheck1" runat="server" Style="width: 40px;" AutoPostBack="True" OnCheckedChanged="SharedCheck1_OnCheckedChanged" Checked="False" CausesValidation="False" />
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="SharedCheck1" />
        </Triggers>
        <ContentTemplate>
                    <!--RaxComboBox enables or disables radtextbox in UpdatePanel3 -->
                    <telerik:RadComboBox ID="OtherFundingOrg1" runat="server" Width="210px" ReadOnlyStyle-CssClass="ReadOnlyStyle" AutoPostBack="True" OnItemChecked="OtherFundingOrg1_OnItemChecked"
                        DisabledStyle-CssClass="ReadOnlyStyle" ExpandDirection="Down" EnableScreenBoundaryDetection="false" CausesValidation="False" OnClientDropDownClosing="OnClientDropDownClosing"
                        DataTextField="Item2" DataValueField="Item1" CheckBoxes="true" Height="100px">
                        <ExpandAnimation Duration="150" Type="None" />
                        <CollapseAnimation Duration="150" Type="None" />
                    </telerik:RadComboBox>
 
            <asp:UpdatePanel runat="server" id="UpdatePanel3">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="OtherFundingOrg1" />
                </Triggers>
                <ContentTemplate>
                            <telerik:RadTextBox ID="DescribeOther1" runat="server" Width="220px" MaxLength="800" ReadOnlyStyle-CssClass="ReadOnlyStyle" AutoPostBack="True" OnTextChanged="DescribeOther1_OnTextChanged" CausesValidation="False"
                                DisabledStyle-CssClass="ReadOnlyStyle" TextMode="MultiLine" Height="67px">
                            </telerik:RadTextBox>
                </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
    </asp:UpdatePanel>

I am willing to change my approach if I am doing it wrong, poorly, or in an ill-advised manner.  My main criteria here is to minimize redraws from postbacks.  

0
Boyan Dimitrov
Telerik team
answered on 06 Aug 2013, 12:46 PM
Hello,

Indeed the post-back is causing the RadComboBox to close when user checks/unchecks a specific item. One way to allow the customer to check/uncheck multiple items without closing the drop down list  is to use the RadComboBox OnTextChanged server-side event handler. That way the drop down list will remain open until user clicks outside of the input element or clicks on the tab key. In the event handler you are absolutely able to access all checked items and perform your custom logic.
//code behind
RadComboBox1.CheckedItems



Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ComboBox
Asked by
Blair
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Blair
Top achievements
Rank 1
Share this question
or