Generally there are two approaches to solve the issue:
1. Use the Visibility property to manage if the item is visible or not.
2. Filter the data provider to include only the items that need to be displayed.
I would recommend the second approach. Semantics of the data context is that it contains the data that should be displayed. You can wrap your data provider (suppose it is some kind of collection) in custom class exposing the original data provider collection and additional property exposing only the required items. Of course you need to maintain the both collection when one of them change.
If second approach is not applicable in some reason you can employ the first one.
I attached a working sample demonstrating how to show only required elements. There are several steps that worth attention:
1. Create view model for the tree view.
2. Extend the view model with additional Visibility property.
3. Bind view model Visibility to the tree view item Visibility.
4. Implement INotifyChanged interface in order to support two way binding.
5. Work with visibility property of the data to manage when the tree view item is visible or not.
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? Explore the Telerik Public Issue Tracking
system and vote to affect the priority of the items