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

Items are not visible for first time loading in RadComboBox

1 Answer 123 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mary
Top achievements
Rank 1
Mary asked on 18 May 2011, 11:23 AM
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?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 May 2011, 01:21 PM
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.
Tags
ComboBox
Asked by
Mary
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or