I am loading the dropdown on client side page load by calling the Controller action that returs JSON object. The callback function looks as below:
function
(result) {
debugger;
comboBox = $find(
"<%= comboBox.ClientID%>");
for (var i = 0; i < $(result).length; i++) {
var item = result[i];
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(item.FullDescription);
comboItem.set_value(item.PatientIdentifier);
comboBox .get_items().add(comboItem);
if (item.PatientIdentifier == patId) {
comboItem.select();
}
}
});
It populates the combobox except the selection. When calling select() it throws an exception in the following line:
__doPostBack(
'ctl00$PageHeadTitle$comboBox','{"Command":"Select","Index":0}')
I tried to cancel the default behavior as below:
// This cancels the default RadComboBox behavior
function itemsRequesting(sender, args) {
args.set_cancel(
true);
}
It does not select the given item. Please guide me about how to select an item after binding it on client side.
Thanks