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

ComboBox doesn't expand after reload

3 Answers 78 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kovach
Top achievements
Rank 1
Kovach asked on 14 May 2012, 03:32 PM
I have two combo boxes, where second are loading/reloading by selected item from first.
I am using OnClientSelectedIndexChangingand  and OnClientItemsRequested to make dependency this two combos.
After selecting item from first combo, second combo doesn't expand when I click on him.
But if I click anywhere else and then on second combo it expand.
This was working till last update of telerik.

Any idea to solv this?
Thank you

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 May 2012, 07:09 AM
Hello,

Here is the sample code that I tried in the version(2012, 1, 411, 35) which worked as expected.
aspx:
<telerik:RadComboBox ID="RadComboBox1" runat="server" OnItemsRequested="RadComboBox1_ItemsRequested"
            OnClientSelectedIndexChanging="loadProducts" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"</telerik:RadComboBox>
<telerik:RadComboBox ID="RadComboBox2" runat="server" OnItemsRequested="RadComboBox2_ItemsRequested"
            OnClientItemsRequested="ItemsLoaded">
</telerik:RadComboBox>
JS:
<script type="text/javascript">
 var productCombo;
    function pageLoad()
   {
     productCombo = $find("<%= RadComboBox2.ClientID %>");
  }
function loadProducts(sender, eventArgs)
 {
  var item = eventArgs.get_item();
  productCombo.set_text("Loading...");
  if (item.get_index() > 0)
  {
   productCombo.requestItems(item.get_value(), false);
  }
  else
{
   productCombo.set_text("");
   productCombo.clearItems();
}
}
 function ItemsLoaded(sender, eventArgs)
 {
        if (sender.get_items().get_count() > 0)
       {
            sender.set_text(sender.get_items().getItem(0).get_text());
            sender.get_items().getItem(0).highlight();
        }
 sender.showDropDown();
    }
</script>

Thanks,
Princy.
0
Kovach
Top achievements
Rank 1
answered on 15 May 2012, 09:21 AM
Princy,

thank you for taking your time to considered my problem,
 but i have already done the posted (from first line to last :-) ) and it still doesn't expands.
After sender.showdropdown() the second combo got focus but doesn't expand.
0
Princy
Top achievements
Rank 2
answered on 15 May 2012, 09:54 AM
Hi Kovach,

Unfortunately I couldn't replicate the issue you are facing. The above code is working fine at my end. Please specify if you are facing any javascript error.

Thanks,
Princy.

Tags
ComboBox
Asked by
Kovach
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kovach
Top achievements
Rank 1
Share this question
or