windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-4566f5f2.md
Gets the parent node of the current tree node.
Namespace : DevExpress.XtraTreeList.Nodes
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
[Browsable(false)]
public TreeListNode ParentNode { get; }
<Browsable(False)>
Public ReadOnly Property ParentNode As TreeListNode
| Type | Description |
|---|---|
| TreeListNode |
A TreeListNode instance that represents the parent of the current tree node.
|
If a tree node is at the root level, the ParentNode property returns null.
The following code snippets (auto-collected from DevExpress Examples) contain references to the ParentNode 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.
drag-drop-grid-rows-to-treelist/CS/DragAndDropRows/Form1.cs#L82
if(destIndex > -1) {
treeList.MoveNode(node, destNode.ParentNode, true, destIndex);
destIndex++;
winforms-treelist-create-file-manager-drag-drop-files-folders/CS/FileList/FileListHelper.cs#L170
{
if (e.Node.ParentNode == Tree.FocusedNode.ParentNode)
{
winforms-treelist-implement-group-level-style-feature/CS/Q220534/Form1.cs#L29
e.Cache.FillRectangle(e.Cache.GetSolidBrush(GetColorByLevel(kvp.Key)), kvp.Value);
if (e.Node.ParentNode == null) {
Pen linePen = e.Cache.GetPen(tree.ViewInfo.PaintAppearance.HorzLine.BackColor);
winforms-treelist-custom-check-nodes-behavior/CS/Example/TreeListCheckHelper.cs#L32
else node.CheckAll();
while(node.ParentNode != null)
{
winforms-treelist-sync-position-of-nodes-with-data-records/CS/Q351285/Form1.cs#L58
private void SaveNewRecordPosition(NodeEventArgs e) {
var nodes = e.Node.ParentNode == null ? e.Node.TreeList.Nodes
: e.Node.ParentNode.Nodes;
drag-drop-grid-rows-to-treelist/VB/DragAndDropRows/Form1.vb#L78
If destIndex > -1 Then
treeList.MoveNode(node, destNode.ParentNode, True, destIndex)
destIndex += 1
winforms-treelist-implement-group-level-style-feature/VB/Q220534/Form1.vb#L28
Next kvp
If e.Node.ParentNode Is Nothing Then
Dim linePen As Pen = e.Cache.GetPen(tree.ViewInfo.PaintAppearance.HorzLine.BackColor)
winforms-treelist-custom-check-nodes-behavior/VB/Example/TreeListCheckHelper.vb#L32
End If
Do While node.ParentNode IsNot Nothing
node = node.ParentNode
winforms-treelist-create-file-manager-drag-drop-files-folders/VB/FileList/FileListHelper.vb#L142
If Equals(e.Node(treeListColumn3).ToString(), "File") Then
If e.Node.ParentNode Is Tree.FocusedNode.ParentNode Then
e.ImageIndex = -1
winforms-treelist-sync-position-of-nodes-with-data-records/VB/Q351285/Form1.vb#L72
Private Sub SaveNewRecordPosition(ByVal e As NodeEventArgs)
Dim nodes = If(e.Node.ParentNode Is Nothing, e.Node.TreeList.Nodes, e.Node.ParentNode.Nodes)
For i = 0 To nodes.Count - 1
See Also