Back to Devexpress

How to: Expand selected nodes

windowsforms-5678-controls-and-libraries-tree-list-examples-focus-and-selection-how-to-expand-selected-nodes.md

latest592 B
Original Source

How to: Expand selected nodes

  • Nov 13, 2018

The following code demonstrates how to traverse through selected nodes, in order to expand them. The selected nodes are accessed via the TreeList.Selection property.

csharp
for(int i = 0; i < treeList1.Selection.Count; i++) {
   treeList1.Selection[i].Expanded = true;
}
vb
Dim i As Integer
For i = 0 To TreeList1.Selection.Count - 1
   TreeList1.Selection(i).Expanded = True
Next i