1
votes

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

2
To show selected item for Telerik RadComboBox stackoverflow.com/questions/12606197/… - user1796141

2 Answers

1
votes

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();
}
0
votes

RadCombo allows to set up SelectedValue and Text properties even through there are no items in it.