Is there a way to automatically expand all nodes from a treeview in WPF? I searched and didn\'t even find an expand function in the treeview property.
Thanks
if you want expand manually you can try
Xaml:
c#:
bool Expanded = false;
// The event subscription method (for a button click)
private void ButtonExpand__Click(object sender, RoutedEventArgs e)
{
Expanded = !Expanded;
Style Style = new Style
{
TargetType = typeof(TreeViewItem)
};
Style.Setters.Add(new Setter(TreeViewItem.IsExpandedProperty, Expanded));
TreePeople.ItemContainerStyle = Style;
}