Tag Archives: treeview

WPF TreeView with hierarchical data

TreeView control allows you to create an hierarchical structure. You can tell it to bind elements and also how it should bind the children, grandchildren and so on.

One simple example is as follows:

<TreeView>
  <TreeViewItem Header="Character 1">
    <TreeViewItem Header="Character 1's child">
      <TreeViewItem Header="Character 1's child's child"/>
    </TreeViewItem>
    <TreeViewItem Header="12345"/>
  </TreeViewItem>
 <TreeViewItem Header="Another char">
    <TreeViewItem Header="Char Bla"/>
    <TreeViewItem Header="Char Foo"/>
    <TreeViewItem Header="98765"/>
  </TreeViewItem>
</TreeView>

Continue reading

Advertisements