Back to Devexpress

TreeListNodes.Count Property

windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnodes-1ff882a8.md

latest5.8 KB
Original Source

TreeListNodes.Count Property

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

Declaration

csharp
public int Count { get; }
vb
Public ReadOnly Property Count As Integer

Property Value

TypeDescription
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.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/TreeList/TreeListItemControlProvider.cs#L47

csharp
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

csharp
: 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

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

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

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

winforms-spreadsheetcontrol-api-part-3/CS/SpreadsheetControl_API_Part03/Form1.cs#L359

csharp
treeList1.ExpandAll();
if (treeList1.Nodes.Count > 0)
    treeList1.FocusedNode = treeList1.FindNodeByFieldValue("", firstGroupName).NextVisibleNode;

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/TreeList/TreeListItemControlProvider.vb#L51

vb
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

vb
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

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

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

vb
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

vb
treeList1.ExpandAll()
    If treeList1.Nodes.Count > 0 Then treeList1.FocusedNode = treeList1.FindNodeByFieldValue("", firstGroupName).NextVisibleNode
End Sub

See Also

TreeListNodes Class

TreeListNodes Members

DevExpress.XtraTreeList.Nodes Namespace