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.
Please let me know if my answer satisfy your needs.
All the best,
TeamX2_Pavel
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.
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 ?
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 02 Oct 2012, 02:51 PM
Hello Kumar,
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.
You may read more about this approach in our Help Article or take a look through our Demo Project.