Presenting Hierarchical Data with the TreeView Control

The TreeView is another important control, and WPF provides its own implementation that exposes a TreeView.Items collection where you nest nodes. Each node is represented by a TreeViewItem object. You can build complex items as in the following example:

<TreeView Name="TreeView1">    <TreeView.Items>        <TreeViewItem Header="Root Node" Name="RootNode"                      Tag="Information for this node">            <TreeViewItem Header="Node0" Name="Node0"/>            <TreeViewItem Header="Node1" Name="Node1">                <TreeViewItem Header="SubNode"                              Name="SubNode"/>            </TreeViewItem>        </TreeViewItem>    </TreeView.Items> ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.