I've managed to implement a CollectionChanged event handler in my view model which matches the new item's parent id with the id of the corresponding item in the collection and set the new item's Parent object to that.
I've used the search technique as described in the Implement Search, Filter and Sort help topic. It works but it is slow. (I think I also read using GetItemByPath can be slow in some situations so this must be one). Is there a faster way?
sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
(e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
//if parent id is not null
ObservableCollection<TreeItem> o = sender
TreeItem p = o.FirstOrDefault(x => x.Id == (e.NewItems
//find the matching parent item in the collection
IPath).Parent = p;
//and set the item's parent to it so we can generate the full path to it later when searching
This is an extract from the help topic:
RadTreeViewItem item = radTreeView.GetItemByPath(category.Path +