Back to Devexpress

TreeListColumnCollection.Count Property

windowsforms-devexpress-dot-xtratreelist-dot-columns-dot-treelistcolumncollection-0aaddf38.md

latest4.4 KB
Original Source

TreeListColumnCollection.Count Property

Gets the number of elements actually contained in the collection.

Namespace : DevExpress.XtraTreeList.Columns

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

An integer value that specifies the number of elements actually contained in the 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-treelist-copy-nodes-to-another-treelist/CS/CopyNodesExample/MainForm.cs#L42

csharp
private TreeListNode CopyNode(TreeListNode sourceNode, TreeListNodes targetNodes) {
    int columnCount = sourceNode.TreeList.Columns.Count;
    object[] values = Enumerable.Range(0, columnCount).Select(x => sourceNode.GetValue(x)).ToArray();

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/GanttItem/GanttItemControlProvider.cs#L118

csharp
for(int i = 0; i < gantt.Columns.Count; i++) {
    var column = gantt.Columns[i];

winforms-treelist-customize-node-menu/CS/Form1.cs#L21

csharp
new DevExpress.XtraTreeList.Design.XViews(treeList1);
for(int i = 1; i < treeList1.Columns.Count; i++)
    treeList1.Columns[i].Visible = false;

winforms-treelist-copy-nodes-to-another-treelist/VB/CopyNodesExample/MainForm.vb#L45

vb
Private Function CopyNode(ByVal sourceNode As TreeListNode, ByVal targetNodes As TreeListNodes) As TreeListNode
    Dim columnCount = sourceNode.TreeList.Columns.Count
    Dim values As Object() = Enumerable.Range(0, columnCount).[Select](Function(x) sourceNode.GetValue(x)).ToArray()

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/GanttItem/GanttItemControlProvider.vb#L118

vb
For i As Integer = 0 To gantt.Columns.Count - 1
    Dim column = gantt.Columns(i)

winforms-treelist-customize-node-menu/VB/Form1.vb#L22

vb
Dim tmp_XViews = New Design.XViews(treeList1)
For i As Integer = 1 To treeList1.Columns.Count - 1
    treeList1.Columns(i).Visible = False

See Also

TreeListColumnCollection Class

TreeListColumnCollection Members

DevExpress.XtraTreeList.Columns Namespace