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

2 posts, 0 answers
  1. Mike
    Mike avatar
    36 posts
    Member since:
    Sep 2012

    Posted 24 Apr 2014 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Apr 2014 in reply to Mike Link to this post

    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. 
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top