Back to Devexpress

TreeListColumnCollection.Add(TreeListColumn) Method

windowsforms-devexpress-dot-xtratreelist-dot-columns-dot-treelistcolumncollection-dot-add-x28-devexpress-dot-xtratreelist-dot-columns-dot-treelistcolumn-x29.md

latest4.1 KB
Original Source

TreeListColumnCollection.Add(TreeListColumn) Method

Adds the specified column to the end of the collection.

Namespace : DevExpress.XtraTreeList.Columns

Assembly : DevExpress.XtraTreeList.v25.2.dll

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

Declaration

csharp
public int Add(
    TreeListColumn column
)
vb
Public Function Add(
    column As TreeListColumn
) As Integer

Parameters

NameTypeDescription
columnTreeListColumn

An object that specifies the column to be added.

|

Returns

TypeDescription
Int32

A value that specifies the position into which the column was inserted.

|

Remarks

If the collection already contains the specified column, the Add method returns this column position within the collection.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(TreeListColumn) method.

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.

xaf-win-gantt-control/CS/XPO/GanttSolutionXPO/GanttSolutionXPO.Win/Editors/CustomGanttEditor.cs#L75

csharp
ganttColumn.Format.FormatType = DevExpress.Utils.FormatType.Custom;
    control.Columns.Add(ganttColumn);
}

zip-compression-and-archive-api-examples/CS/CompressionLibraryExamples/Form1.cs#L29

csharp
treeList1.Columns.Add(new TreeListColumn() { Caption = "Action", VisibleIndex = 0, SortOrder = SortOrder.Ascending });
treeList1.DataSource = treeDataSource;

zip-compression-and-archive-api-examples/VB/CompressionLibraryExamples/Form1.vb#L33

vb
treeList1.Columns.Add(New TreeListColumn() With {.Caption = "Action", .VisibleIndex = 0, .SortOrder = SortOrder.Ascending})
treeList1.DataSource = treeDataSource

See Also

Columns

AddRange(TreeListColumn[])

Insert(Int32)

Remove(TreeListColumn)

TreeListColumnCollection Class

TreeListColumnCollection Members

DevExpress.XtraTreeList.Columns Namespace