Hello, I have a trouble adding items to RadComboBox in client side.
I tried to add items in two different ways:
In this way:
FillServiceTypes: function () {
var i = 0;
var servTypeComboBox = $find("<%= rcbServiceTypes.ClientID%>");
for (i = 0; i <= 5; i++) {
var rcbItem = new Telerik.Web.UI.RadComboBoxItem();
rcbItem.set_text("Item " + i);
rcbItem.set_value(i);
servTypeComboBox.trackChanges();
servTypeComboBox.get_items().add(comboItem);
servTypeComboBox.select();
servTypeComboBox.commitChanges();
}
}
And in this other:
FillServiceTypes: function () {
var i = 0;
var items = [];
var servTypeComboBox = $find("<%= rcbServiceTypes.ClientID%>");
for (i = 0; i <= 5; i++) {
var rcbItem = new Telerik.Web.UI.RadComboBoxItem();
rcbItem.set_text("Item " + i);
rcbItem.set_value(i);
items[items.length] = rcbItem;
}
servTypeComboBox.insertItems(items);
}
In both ways i received this error:
Microsoft JScript runtime error: Object doesn't support this property or method
Can someone help me how to resolve this trouble?, please.
Thanks in advance.
Francisco.
I tried to add items in two different ways:
In this way:
FillServiceTypes: function () {
var i = 0;
var servTypeComboBox = $find("<%= rcbServiceTypes.ClientID%>");
for (i = 0; i <= 5; i++) {
var rcbItem = new Telerik.Web.UI.RadComboBoxItem();
rcbItem.set_text("Item " + i);
rcbItem.set_value(i);
servTypeComboBox.trackChanges();
servTypeComboBox.get_items().add(comboItem);
servTypeComboBox.select();
servTypeComboBox.commitChanges();
}
}
And in this other:
FillServiceTypes: function () {
var i = 0;
var items = [];
var servTypeComboBox = $find("<%= rcbServiceTypes.ClientID%>");
for (i = 0; i <= 5; i++) {
var rcbItem = new Telerik.Web.UI.RadComboBoxItem();
rcbItem.set_text("Item " + i);
rcbItem.set_value(i);
items[items.length] = rcbItem;
}
servTypeComboBox.insertItems(items);
}
In both ways i received this error:
Microsoft JScript runtime error: Object doesn't support this property or method
Can someone help me how to resolve this trouble?, please.
Thanks in advance.
Francisco.