We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to bind hierarchical data in multiple columns using TreeViewAdv control?

This article describes how to bind hierarchical data in multiple columns using TreeViewAdv control. Follow the below steps to populate TreeViewAdv control with hierarchical multiple column data.

Enable multiple columns

Set the property MultiColumnEnable of TreeViewAdv to enable multiple columns support in TreeViewAdv control.

Add columns

Add the required number of TreeViewColumn to the TreeViewColumnCollection and set it to the Columns property of TreeViewAdv control.

Column Header

Set header for each TreeViewColumn using its Header property.

Column CellTemplate

Set data template property for each TreeViewColumn using its CellTemplate property.

Set ItemTemplate

Use HierarchicalDataTemplate instead of DataTemplate to set ItemTemplate property of TreeViewAdv control, because DataTemplate cannot render hierarchical data. ItemsControl property of HierarchicalDataTemplate must be set, since it indicates where to find the collection that represents the next level in the data hierarchy.

The following code example demonstrates the same.

C#

 

XAML

 

The following screenshot illustrates the output.

Figure 1:  Child nodes expanded from parent node in TreeViewAdv

 

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
7140 11/14/2016 11/14/2016 WPF TreeViewAdv
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon