title: Treeview with multiple columns
body: <p>I am trying to create a treeview in WPF with multiple columns. I am well aware, that there are really numerous questions regarding this subject. However they seem to take a different approach when binding the data. Everybody seems to set the itemssource, as where I fill the treeview.items in de code behind. That is also the reason I am not sure whether to use ItemTemplate / HierarchicalDataTemplate or the correct way to accomplish it. (I have the feeling that this should be an easy step.)</p>
  
  <p>The code I have now is as follows:</p>
  
  <p>Treeview in Mainwindow.xaml</p>
  
  <pre><code>&lt;TreeView x:Name="ProcesTree" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt;
      &lt;TreeView.ItemTemplate&gt;
          &lt;ItemContainerTemplate&gt;
              &lt;Grid&gt;
                  &lt;TextBlock Text="{Binding procesNummer}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0"/&gt;
                  &lt;TextBlock Text="{Binding procesNaam}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0"/&gt;
              &lt;/Grid&gt;
          &lt;/ItemContainerTemplate&gt;
      &lt;/TreeView.ItemTemplate&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>Mainwindow.xaml.cs</p>
  
  <pre><code>public List&lt;Proces&gt; processen = new List&lt;Proces&gt;();
  
  public MainWindow() {
      InitializeComponent();
      processen = Database.getHoofdProcessen();
      processen = Extensions.OrderByAlphaNumeric(processen, p =&gt; p.procesNummer);
  
      foreach (Proces p in processen) {
          writeProcesses(p, ProcesTree.Items);
      }
  }
  
  
  public void writeProcesses(Proces p, ItemCollection tv) {
      tv.Add(p);
  
      List&lt;Proces&gt; processen = Database.getProcessenOnNummer((p.procesNummer + ".%"));
      if (processen.Count != 0) {
          foreach (Proces pr in processen) {
                  writeProcesses(pr, p.Items);
              }
      }
  }
  </code></pre>
  
  <p>Proces class:</p>
  
  <pre><code>public class Proces : TreeViewItem {
      public Int64 procesId { get; set; }
      public String procesNummer { get; set; }
      public String procesNaam { get; set; }
      public String procesOmschrijvig { get; set; }
      public Boolean procesEinde { get; set; }
  }
  </code></pre>
  
  <p>@Edit - To be clear, I now have a structure like the following image. The only thing that misses is the template? as how it should be shown:
  <img src="https://i.stack.imgur.com/pB5Zb.png" alt="Treeview"></p>