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

Add Item to RadComboBox

1 Answer 1631 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Neelima
Top achievements
Rank 1
Neelima asked on 03 Mar 2012, 12:32 AM
Hi,

I followed the below blog post to load items from WCF Service.
http://blogs.telerik.com/veselinvasilev/posts/09-04-08/how-to-use-wcf-services-with-asp-net-ajax-databound-controls.aspx

I need to add an item 'Primary' to this Combobox. Also I dont want this item to be filtered out based on the CustomText the user types in.
This item always needs to be there in the ComboBox.

Any suggestions ???


Thank you for your help,
Neelima

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 07 Mar 2012, 03:57 PM
Hi Neelima,

The idea of load on demand mechanism is to load the items when needed. You could however do the following to make your scenario work. You could add an item to RadComboBox items collection as it is shown in the code below:
<telerik:RadComboBox runat="server" ID="RadComboBox1" Height="100px"
    EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
    EmptyMessage="Type here ..." AppendDataBoundItems="true">
    <Items>
        <telerik:RadComboBoxItem Text="item1" />
    </Items>
    <WebServiceSettings Path="ComboBoxWcfService.svc" Method="LoadData" />
</telerik:RadComboBox>
When loading of items against the typed text in the input area will take place the initially added item "item1" will be removed. To overcome this behavior, you could make some modifications in the LoadData method and add a default item every time a new set of items is requested.

I hope this helps.

Greetings,
Ivana
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.
Tags
ComboBox
Asked by
Neelima
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Share this question
or