windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnodes-1ff882a8.md
Gets the number of nodes in the current node collection, without taking into account children of these nodes.
Namespace : DevExpress.XtraTreeList.Nodes
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
public int Count { get; }
Public ReadOnly Property Count As Integer
| Type | Description |
|---|---|
| Int32 |
The number of nodes in the current node collection.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the Count 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.
private void Tree_CustomDrawEmptyArea(object sender, CustomDrawEmptyAreaEventArgs e) {
if(tree.Nodes.Count > 1) return;
e.DefaultDraw();
winforms-treelist-sync-position-of-nodes-with-data-records/CS/Q351285/Form1.cs#L60
: e.Node.ParentNode.Nodes;
for(var i = 0; i < nodes.Count; i++) {
nodes[i].SetValue(colSort, i);
winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/Form1.cs#L197
treeList1.ExpandAll();
if (treeList1.Nodes.Count > 0)
treeList1.FocusedNode = treeList1.MoveFirst().FirstNode;
winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/Form1.cs#L185
treeList1.ExpandAll();
if (treeList1.Nodes.Count > 0)
treeList1.FocusedNode = treeList1.MoveFirst().FirstNode;
winforms-spreadsheetcontrol-api-part-3/CS/SpreadsheetControl_API_Part03/Form1.cs#L359
treeList1.ExpandAll();
if (treeList1.Nodes.Count > 0)
treeList1.FocusedNode = treeList1.FindNodeByFieldValue("", firstGroupName).NextVisibleNode;
Private Sub Tree_CustomDrawEmptyArea(ByVal sender As Object, ByVal e As CustomDrawEmptyAreaEventArgs)
If tree.Nodes.Count > 1 Then
Return
winforms-treelist-sync-position-of-nodes-with-data-records/VB/Q351285/Form1.vb#L73
Dim nodes = If(e.Node.ParentNode Is Nothing, e.Node.TreeList.Nodes, e.Node.ParentNode.Nodes)
For i = 0 To nodes.Count - 1
nodes(i).SetValue(colSort, i)
winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/Form1.vb#L190
treeList1.ExpandAll()
If treeList1.Nodes.Count > 0 Then
treeList1.FocusedNode = treeList1.MoveFirst().FirstNode
winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/Form1.vb#L176
treeList1.ExpandAll()
If treeList1.Nodes.Count > 0 Then
treeList1.FocusedNode = treeList1.MoveFirst().FirstNode
winforms-spreadsheetcontrol-api-part-3/VB/SpreadsheetControl_API_Part03/Form1.vb#L350
treeList1.ExpandAll()
If treeList1.Nodes.Count > 0 Then treeList1.FocusedNode = treeList1.FindNodeByFieldValue("", firstGroupName).NextVisibleNode
End Sub
See Also