Back to Devexpress

TreeListNode.FirstNode Property

windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-e8cd0cb7.md

latest5.9 KB
Original Source

TreeListNode.FirstNode Property

Gets the first child node.

Namespace : DevExpress.XtraTreeList.Nodes

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[Browsable(false)]
public virtual TreeListNode FirstNode { get; }
vb
<Browsable(False)>
Public Overridable ReadOnly Property FirstNode As TreeListNode

Property Value

TypeDescription
TreeListNode

A TreeListNode object which represents the first child node. null ( Nothing in Visual Basic) if the current node has no child nodes.

|

Remarks

Each node can have children. The child nodes are contained within their parent’s TreeListNode.Nodes collection. The FirstNode method returns the first element in this collection.

The following code snippets (auto-collected from DevExpress Examples) contain references to the FirstNode 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-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/Form1.cs#L198

csharp
if (treeList1.Nodes.Count > 0)
        treeList1.FocusedNode = treeList1.MoveFirst().FirstNode;
}

winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/Form1.cs#L186

csharp
if (treeList1.Nodes.Count > 0)
        treeList1.FocusedNode = treeList1.MoveFirst().FirstNode;
}

winforms-richeditcontrol-common-api/CS/RichEditAPISample/Form1.cs#L460

csharp
if(treeList1.Nodes.Count > 0)
        treeList1.FocusedNode = treeList1.MoveFirst().FirstNode;
}

word-document-api-examples/CS/Form1.cs#L84

csharp
if (treeList1.Nodes.Count > 0)
    treeList1.FocusedNode = treeList1.MoveFirst().FirstNode;
RichEditExample example = treeList1.GetDataRecordByNode(treeList1.FocusedNode) as RichEditExample;

spreadsheet-document-api-examples-part2/CS/SpreadsheetDocServerAPIPart2/Form1.cs#L144

csharp
if (treeList1.Nodes.Count > 0)
        treeList1.FocusedNode = treeList1.MoveFirst().FirstNode;
}

winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/Form1.vb#L191

vb
If treeList1.Nodes.Count > 0 Then
    treeList1.FocusedNode = treeList1.MoveFirst().FirstNode
End If

winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/Form1.vb#L177

vb
If treeList1.Nodes.Count > 0 Then
    treeList1.FocusedNode = treeList1.MoveFirst().FirstNode
End If

winforms-richeditcontrol-common-api/VB/RichEditAPISample/Form1.vb#L455

vb
If treeList1.Nodes.Count > 0 Then
    treeList1.FocusedNode = treeList1.MoveFirst().FirstNode
End If

word-document-api-examples/VB/Form1.vb#L80

vb
treeList1.ExpandAll()
If treeList1.Nodes.Count > 0 Then treeList1.FocusedNode = treeList1.MoveFirst().FirstNode
Dim example As RichEditExample = TryCast(treeList1.GetDataRecordByNode(treeList1.FocusedNode), RichEditExample)

spreadsheet-document-api-examples-part2/VB/SpreadsheetDocServerAPIPart2/Form1.vb#L128

vb
treeList1.ExpandAll()
    If treeList1.Nodes.Count > 0 Then treeList1.FocusedNode = treeList1.MoveFirst().FirstNode
End Sub

See Also

Nodes

LastNode

TreeListNode Class

TreeListNode Members

DevExpress.XtraTreeList.Nodes Namespace