The SelectedItems collection is not being emptied with the Clear() method

2 posts, 1 answers
  1. Paul
    Paul avatar
    33 posts
    Member since:
    Aug 2011

    Posted 19 Oct 2011 Link to this post

    I’ve tried the following to clear all selection from a TreeList:

    tlConfig.SelectedItems.Clear()

     

    Nothing was removed from the selected collection. I then used the brute force method and it works:

    For Each selectedItem As TreeListDataItem In tlConfig.SelectedItems

        selectedItem.Selected = False

    Next

     

    Am I missing something with the Clear() method?

    Thanks,
    Paul

  2. Answer
    Marin
    Admin
    Marin avatar
    1057 posts

    Posted 24 Oct 2011 Link to this post

    Hello Paul,

     In order to clear all selected items you should use the ClearSelectedItems method of the RadTreeList. The controls internally keeps the selected indexes of the items that is why clearing just the SelectedItems collection does not work. 

    All the best,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top