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

RadComboBox not Closing on RadSearchBox

1 Answer 78 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Javier
Top achievements
Rank 1
Javier asked on 06 Jun 2016, 05:43 PM

Hello all:

I'm having an issue with RadComboBox not closing the drop down list when moving to a RadSearchBox.

I have a RadSearchBox in the master page and several RadComboBoxes all over the web application, but when I open the list of the RadComboBox and click on the RadSearchBox the RadComboBox list does not close.

the expected behavior is that when the user clicks outside any RadComboBox the list is closed, and this is true except when clicking on a RadSearchBox.

Regards,

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 09 Jun 2016, 01:08 PM
Hello Javier,

I am afraid we have to confirm this is a bug. You could track the status of the bug in the Ajax Feedback Portal. One possible workaround is to close manually the dropdown of the ComboBox manually when the focus is on the SearchBox. Here is a sample implementation: 

<telerik:RadComboBox RenderMode="Lightweight" ID="RadComboBox2" runat="server">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="One" />
        <telerik:RadComboBoxItem runat="server" Text="Two" />
        <telerik:RadComboBoxItem runat="server" Text="Three" />
    </Items>
</telerik:RadComboBox>
<telerik:RadSearchBox  RenderMode="Lightweight" runat="server" ID="RadSearchBox2"
    OnClientLoad="onLoad">
</telerik:RadSearchBox>
<script>
    var $ = $telerik.$;
    function onLoad(sender, args) {
        $(sender.get_inputElement()).focus(function () {
            var comboBoxes = Telerik.Web.UI.RadComboBox.ComboBoxes;
            for (var i = 0; i < comboBoxes.length; i++) {
                var combo = comboBoxes[i];
                if (combo.get_dropDownVisible()) {
                    combo.toggleDropDown();
                }
            }
        });
    }
</script>

Your Telerik points are updated.

Regards,
Peter Milchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Javier
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or