You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# How to programmatically expand the root nodes in WinForms TreeViewAdv?
1
+
# How to programmatically expand the root nodes in WinForms TreeView?
2
2
3
-
You can expand the [Root](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Tools.TreeViewAdv.html#Syncfusion_Windows_Forms_Tools_TreeViewAdv_Root) nodes of the [WinForms TreeViewAdv](https://www.syncfusion.com/winforms-ui-controls/treeview) by using the [Expand](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Tools.TreeNodeAdv.html#Syncfusion_Windows_Forms_Tools_TreeNodeAdv_Expand) method of the node.
3
+
This session explains how to programmatically expand the root nodes in [WinForms TreeView](https://help.syncfusion.com/windowsforms/treeview/overview) (TreeViewAdv).
4
4
5
-
```csharp
5
+
You can expand the [Root](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Tools.TreeViewAdv.html#Syncfusion_Windows_Forms_Tools_TreeViewAdv_Root) nodes of the [TreeViewAdv](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Tools.TreeViewAdv.html) by using the [Expand](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Tools.TreeNodeAdv.html#Syncfusion_Windows_Forms_Tools_TreeNodeAdv_Expand) method of the node.
6
+
7
+
```csharp
6
8
TreeNodeAdvroot=this.treeViewAdv1.Root;
7
9
8
10
foreach (TreeNodeAdvnodeinroot.Nodes)
9
11
{
12
+
// Call the Expand method on each root node.
10
13
node.Expand();
11
14
}
15
+
12
16
root.Expand();
13
17
```
18
+
19
+

0 commit comments