I am trying to add default item 'All' to my RadComboBox. It is adding at the end and also it doesn't select this default item. What could be the problem? Are there any other ways to do it?
function OnClientItemsRequested(sender, eventArgs) {
var combo = $find("<%= RadComboBox1.ClientID %>");
var intextput = "All";
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(intextput);
comboItem.set_value("");
combo.trackChanges();
combo.get_items().add(comboItem);
comboItem.select();
combo.commitChanges();
comboItem.scrollIntoView();
}
<telerik:RadComboBox runat="server" ID="RadComboBox1"
EnableLoadOnDemand="true"
OnClientItemsRequested="OnClientItemsRequested">
<WebServiceSettings Method="GetMyData" Path="http://localhost:1606/Service1.svc" />
</telerik:RadComboBox>
I also tried with the following option. It adds the 'All' but it doesn't append the values from the database.
<telerik:RadComboBox runat="server" ID="RadComboBox1"
EnableLoadOnDemand="true"
AppendDataBoundItems="true">
<WebServiceSettings Method="GetMyData" Path="http://localhost:1606/Service1.svc" />
<Items>
<telerik:RadComboBoxItem runat="server" Text="All" Value=""/>
</Items>
</telerik:RadComboBox>