WPF TreeView: Where is the ExpandAll() method

mehdi picture mehdi · May 7, 2009 · Viewed 42.8k times · Source

How can I expand all TreeView nodes in WPF? In WinForms there was a ExpandAll() method which does this.

Answer

Prabu Arumugam picture Prabu Arumugam · Aug 5, 2011

This might help

<TreeView>
    <TreeView.ItemContainerStyle>
        <Style TargetType="{x:Type TreeViewItem}">
            <Setter Property="IsExpanded" Value="True" />
        </Style>
    </TreeView.ItemContainerStyle>
</TreeView>