This is a migrated thread and some comments may be shown as answers.

Must call clearSelection before clearItems() in latest Q1 '14 release

1 Answer 23 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 24 Apr 2014, 06:20 PM
I think a bug might have cropped up into the latest Telerik release (Q1 '14, April SP release). Typically, when clearing and adding items to a combo box client side, script like this has worked:

var combo = $find("MyComboList")
combo.trackChanges();
combo.clearItems();
// code to add items
combo.commitChanges();

However, with the current release, the above code will leave the previously selected item in the combo box as well. In order to remove it, you have to manually clear it, so the above code now becomes this:

var combo = $find("MyComboList")
combo.trackChanges();
combo.clearSelection(); // ensures that the current selected item will be removed as well
combo.clearItems();
// code to add items
combo.commitChanges();

This seems like a bug to me. Can someone from Telerik confirm?

Thanks,

Mike Oliver

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Apr 2014, 06:12 AM
Hi Mike,

The ClearItems method of RadComboBox only clears the Items in the DropDownBox of RadCombox. In order to clear the selected item you have to write the ClearSelection . This is the expected behavior of the control.

Thanks,
Shinu. 
Tags
ComboBox
Asked by
Mike
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or