Search code examples
asp.netteleriktelerik-combobox

Telerik RadComboBox AutomaticLoadOnDemand


I use Telerik RadComboBox in my project. I set EnableAutomaticLoadOnDemand="true" on RadComboBox. It works good but when I want to set selected item on load of page event, it doesn't show selected item


Solution

  • With load on demand mode, so combobox does not have any item. It just has item(s) when you action on it.

    In my opinion, you should get the specific item and add it to combobox manually on page load event like this way (I'm not sure the structure, just an idea.)

    if (!IsPostBack)
    {
        var itemSelected = service.GetById(Id); //item Id
        this.combobox.Items.Add(new RadComboboxItem(itemSelected.Id, itemSelected.Name));
        this.combobox.SeletedValue = Id.ToString();
    }