title: Expanded all WPF Treeview Items
body: <p>I'm trying to iterate through my Treeview, expanding all nodes however it runs into an InvalidCastException when ran;</p>
  
  <p>Unable to cast object of type 'System.Data.DataRowView' to type 'System.Windows.Controls.TreeViewItem'.</p>
  
  <p>My Code;</p>
  
  <pre><code>foreach (TreeViewItem treeitem in thetreeView.Items)
  {
     treeitem.IsExpanded = true;
  }
  </code></pre>
  
  <p>Any ideas?  I want to fire this from a button.</p>