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

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

1 Answer 36 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 19 Oct 2011, 08:21 PM

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

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin
Telerik team
answered on 24 Oct 2011, 07:18 AM
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
Tags
TreeList
Asked by
Paul
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or