AutoExpand treeview in WPF

前端 未结 5 2198
悲哀的现实
悲哀的现实 2021-02-06 21:04

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

5条回答
  •  轮回少年
    2021-02-06 21:29

    Another programmatical way to manipulate full expansion of tree items, maybe via c# code, is using the TreeViewItem.ExpandSubTree() command on a root node.

    private void ExpandFirstRootNode()
    {
       TreeViewControl.Items[0].ExpandSubtree();
    }
    

提交回复
热议问题