windowsforms-devexpress-dot-xtratreelist-dot-treelist-97eaaba1.md
Provides access to the collection of the TreeList’s root nodes.
Namespace : DevExpress.XtraTreeList
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
[Browsable(true)]
public TreeListNodes Nodes { get; }
<Browsable(True)>
Public ReadOnly Property Nodes As TreeListNodes
| Type | Description |
|---|---|
| TreeListNodes |
The collection of root nodes.
|
The Nodes returns a collection of the control’s root nodes. Every node can have child nodes which can be accessed with the TreeListNode.Nodes property. In turn, child nodes refer to their parents via the TreeListNode.ParentNode property.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Nodes property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-treelist-sync-position-of-nodes-with-data-records/CS/Q351285/Form1.cs#L21
treeList1.ForceInitialize();
UpdateNodesPositions(treeList1.Nodes);
treeList1.ExpandAll();
winforms-treelist-copy-nodes-to-another-treelist/CS/CopyNodesExample/MainForm.cs#L28
private void CopyButtonItem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
foreach (TreeListNode node in treeList1.Nodes) {
CopyNodeWithChildren(node, treeList2.Nodes);
drag-drop-grid-rows-to-treelist/CS/DragAndDropRows/Form1.cs#L103
return -1000;
var nodes = destNode.ParentNode == null ? treeList.Nodes : destNode.ParentNode.Nodes;
int index = nodes.IndexOf(destNode);
winforms-treelist-sync-position-of-nodes-with-data-records/VB/Q351285/Form1.vb#L27
treeList1.ForceInitialize()
UpdateNodesPositions(treeList1.Nodes)
treeList1.ExpandAll()
winforms-treelist-copy-nodes-to-another-treelist/VB/CopyNodesExample/MainForm.vb#L31
Private Sub CopyButtonItem_ItemClick(ByVal sender As Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs)
For Each node As TreeListNode In treeList1.Nodes
CopyNodeWithChildren(node, treeList2.Nodes)
drag-drop-grid-rows-to-treelist/VB/DragAndDropRows/Form1.vb#L99
If e.InsertType = InsertType.AsChild Then Return -1000
Dim nodes = If(destNode.ParentNode Is Nothing, treeList.Nodes, destNode.ParentNode.Nodes)
Dim index As Integer = nodes.IndexOf(destNode)
See Also