December 20, 2011

Expand WPF TreeView


Questions
- How to expand all WPF TreeView nodes?
- Expand all nodes when a WPF TreeView is loaded
- Where is the default ExpandAll solution for WPF TreeView
- Expand all a WPF HierarchicalDataTemplate TreeView

Solution
Add below codes in XAML in TreeView tag.

  <TreeView.ItemContainerStyle>
      <Style>
          <Setter Property="TreeViewItem.IsExpanded" Value="True"/>
      </Style>
  </TreeView.ItemContainerStyle>

No comments: