Items are not visible for first time loading in RadComboBox

2 posts, 0 answers
  1. Mary
    Mary avatar
    5 posts
    Member since:
    Mar 2011

    Posted 18 May 2011 Link to this post

    Hi,
    Iam adding items to radcombobox  in javascript method which is called in OnKeyUp event of radcombobox.the problem is items are adding but not visible
    my POC is as follows:

    <script type="text/javascript">
        function dropdownBindByMatchedText(sender, args) {

            var comboboxSearch = $find("<%= rdcmbSearch.ClientID %>");
            comboboxSearch.clearItems();
            var item1 = new Telerik.Web.UI.RadComboBoxItem();
            var item2 = new Telerik.Web.UI.RadComboBoxItem();
            var item3 = new Telerik.Web.UI.RadComboBoxItem();
            item1.set_text("a");
            item2.set_text("b");
            item3.set_text("c");
            comboboxSearch.get_items().add(item1);
            comboboxSearch.get_items().add(item2);
            comboboxSearch.get_items().add(item3);
        }
    </script>
        <telerik:RadComboBox ID="rdcmbSearch" OnKeyUp="dropdownBindByMatchedText()"
            EnableLoadOnDemand="true" Height="200px" Width="220px" DropDownWidth="220px"
            wrap="false" runat="server" >
        </telerik:RadComboBox>


    can anybody help me?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 May 2011 Link to this post

    Hello Mary,

    I tried the same scenario with EnableLoadOnDemand as false and it worked as expected in my end.

    aspx:
    <telerik:RadComboBox ID="rdcmbSearch" 
           EnableLoadOnDemand="false" Height="200px" Width="220px" DropDownWidth="220px"  OnKeyUp="dropdownBindByMatchedText()"
           wrap="true" runat="server" >
    </
    telerik:RadComboBox>

    When you set the EnableLoadOnDemand property to True, items already added in the ItemsRequested event handler are cleared when an item is requested. Check the following help documentation which explains about this in detail.
    Load On Demand Overview.

    Thanks,
    Princy.
Back to Top