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

Stopping the Combo Box from auto opening

1 Answer 192 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
David OBrien
Top achievements
Rank 1
David OBrien asked on 25 Mar 2010, 07:46 PM
I have four combo boxes tied together

    <div style="width:985px; padding:10px;"
        <telerik:RadComboBox EnableVirtualScrolling="false" OpenDropDownOnLoad="false" Width="250px" Label="Report Options" ID="RadComboBox1" runat="server" OnClientSelectedIndexChanging="LoadLanCodes" OnClientDropDownOpening="ClearBoxes"
            <Items> 
                <telerik:RadComboBoxItem runat="server" Selected="True" value="" Text="Any" /> 
                <telerik:RadComboBoxItem runat="server" Text="Lan Code" Value="lancode" /> 
                <telerik:RadComboBoxItem runat="server" Text="Support Team" Value="supportteam" /> 
            </Items> 
        </telerik:RadComboBox> 
        <telerik:RadComboBox Width="250px"  EnableVirtualScrolling="false" OpenDropDownOnLoad="false" OnClientItemsRequested="ItemsLoaded" ID="RadComboBox2" runat="server" OnClientSelectedIndexChanging="LoadStates"
        </telerik:RadComboBox> 
        <p> 
        </p> 
        <telerik:RadComboBox Label="State" OpenDropDownOnLoad="false"  EnableVirtualScrolling="false" Width="250px" OnClientItemsRequested="ItemsLoaded" ID="RadComboBox3" runat="server" OnClientSelectedIndexChanging="LoadCities"
        </telerik:RadComboBox> 
        <telerik:RadComboBox Label="City" OpenDropDownOnLoad="false" Width="250px"  EnableVirtualScrolling="false" OnClientItemsRequested="ItemsLoaded" ID="RadComboBox4" runat="server"
        </telerik:RadComboBox> 
    </div> 

When I select a value in the first one once the data loads the drop down expand automatically
When i choose a value for the second combo box the third open on load

I was hoping that  OpenDropDownOnLoad="false" would stop this behavior but it doesn't...

How do I stop it?



1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 26 Mar 2010, 10:48 AM
Hi David OBrien,

As looking at your code I guess you are using this demo.

In the ItemsLoaded event handler is used showdropdown function which opens the drop-down list.

If you remove it the RadComboBoxes will not be opened automatically and there is no need of using OpenDropDownOnLoad="false" property.

function ItemsLoaded(combo, eventArqs)
{   
    if (combo.get_items().get_count() > 0)
    {
        // pre-select the first item
        combo.set_text(combo.get_items().getItem(0).get_text());
        combo.get_items().getItem(0).highlight();
    }
    //combo.showDropDown();
}

Hope this helps.

All the best,
Veronica Milcheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
David OBrien
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or