In your case it is better to use the RadTreeView SelectedContainer
property, instead of the SelectedItem
property. After you get the SelectedContainer
you can use the NextItem
properties of the RadTreeViewItem
to get the next, previous and parent items accordingly. If you need to get all of the children of the currently selected item you can use the ItemsSource
RadTreeViewItem selectedContainer = treeView.SelectedContainer;
RadTreeViewItem nextItem = selectedContainer.NextItem;
RadTreeViewItem previousItem = selectedContainer.PreviousItem;
RadTreeViewItem parent = selectedContainer.ParentItem;
IEnumerable childCollection = selectedContainer.ItemsSource;
I prepared an example for you. Please take a look at it and let me know if it helps or if your scenario requires a different approach.
All the best,
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.