This is an expected behavior since the RadTreeView is virtualized and therefore only the visible items' containers are initialized and those are the only items that the RadTreeView is aware of. Therefore the RadTreeView and the RadTreeView.CheckedItems collection isn't aware of any deeper-level checked items.
However, in the case when the RadTreeView TriStateMode feature is implemented, the RadTreeView evaluates the checked item's immediate children in order to determine the item's proper state. Therefore in the sample project the CheckedItems collection contains only the checked item and its immediate checked children.
So, indeed, you will need to implement your own logic to keep the checked items in a custom collection.
Also, I noticed a small issue in my code sample. In the DataItem class implementation I set the child.isChecked private property by mistake. The code should be:
.isChecked != value)
.Children.Count != 0)
child.IsChecked = value;
.isChecked = value;
I also modified the sample project to illustrate a possible approach towards keeping all checked items in a custom collection. Please give it a try and let me know if it works for you.
On a side note, I just wanted to ask you to keep in mind that the Virtualization of the TreeView is implemented in order to optimize the Tree's performance when thousands of items have to be displayed. Therefore, if your TreeView is not designed to display a big amount of items, it is better not to virtualize it. I am mentioning that since your scenario requires you to work with the entire collection of items, rather than just with the visible once and since this is against the Virtualization logic, you will have to implement most of your custom logic in the ViewModels.
I hope the info helps. Please let me know if I can further assist you.
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items