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
+
3
+
This session explains how to programmatically expand the root nodes in WinForms TreeViewAdv.
2
4
3
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 [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.
4
6
5
-
```csharp
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
+

20
+
21
+
Take a moment to peruse the [WinForms TreeView - Getting Started](https://help.syncfusion.com/windowsforms/treeview/getting-started) documentation, where you can find about treeview with code examples.
0 commit comments