HierarchicalDataTemplate is used when a node of a collection has its own children which are also wrapped in a collection. In order to relate each child to a DataTemplate, the ItemTemplate and ItemsSource properties of the HierarchicalDataTemplate must be used.
In your case a DataTemplate can be used to display the children of EmployeeA and EmployeeB. A HierarchicalDataTemplate is needed to display all employees in one department and one more HierarchicalDataTemplate to display all departments in the collection.
For better understanding and your convenience I have attached a SampleProject which you may go through.
Thanks, am able to build the Radtreeview with child items, I used the load on demand event to load the child items and it works for fine.
The problem here is for every child item there is expand sign but there is a point there are no child items for a parent in that case for the child items I don't want show the expand sign. How can I achieve this ?
Pavel R. Pavlov
answered on 02 Oct 2012, 02:51 PM
You can set the IsLoadOnDemandEnabled property to each RadTreeViewItem separately. It's best to use the RadTreeView.ItemPreparedevent handler to set the IsLoadOnDemandEnabled property to False for those items that won't display any children.