Cascading combo-box not functioning properly

2 posts, 0 answers
  1. Xorv
    Xorv avatar
    19 posts
    Member since:
    Jan 2012

    Posted 08 May 2012 Link to this post

    I've two combo-box(Countries and States). Combo-box 2 (States) should load associated States with the value selected in the Combo-box 1(Countries).

    Problem:- first time selection of a Countries combo-box item, loads the correct associated States in the 2nd combo-box. But when an another value is selected in combo-box 1. The Values inside combo-box still displays old values.

    NOTE:- On 2nd time NewValues are loaded properly in combo-box 2. But those are not displayed when the the combo-box arrow is click (Only old values are visible). But if we type anything in that 2nd combo-box, New values are displayed.

    QUESTION:- I want evertime the new values are loaded up in 2nd combo-box, it should be displayed on the click of combo-box arrow. Not just after typing something.


    protected void Countries_SelectedIndexChanged(Object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        int countryIDselected = Convert.ToInt32(Countries.SelectedValue);
        bool AdvanceSearchFlag = true;
        Session["AdvanceSearchFlag"] = AdvanceSearchFlag;
        Session["countryIDselected"] = countryIDselected.ToString();
        int totalStates = States.Items.Count;
        int xyz = totalStates - 1;        if (totalStates != 0)
            while (totalStates > 0)
                States.Items.Remove(totalStates - 1);
                totalStates --;
    protected void States_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        foreach (StateyLookupInfo state in StateLookupList.GetList(false))
            RadComboBoxItem item = new RadComboBoxItem(State.StateName, State.StateID.ToString());

    <telerik:RadComboBox ID="Countries" runat="server" AutoPostBack="True" OnSelectedIndexChanged="Countries_SelectedIndexChanged" />
    <telerik:RadComboBox ID="States" runat="server" AutoPostBack="True" EnableLoadOnDemand="true" OnItemsRequested="States_ItemsRequested" />
  2. Dimitar Terziev
    Dimitar Terziev avatar
    1266 posts

    Posted 10 May 2012 Link to this post


    In order to force a request for items whenever the second RadComboBox is opened, the OnClientDropDownOpening event should be handled with the following implementation of the event handler function:
    function OnClientDropDownOpening(sender, args) {
          if (sender.get_items().get_count() > 0)
              sender.requestItems("", false);

    Dimitar Terziev
    the Telerik team
    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 their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top