Skip to main content
A newer version of this page is available. .

TreeList.PopulateColumns() Method

Creates columns for all fields in the bound data source.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v19.2.dll

Declaration

public virtual void PopulateColumns()

Remarks

The PopulateColumns method is in effect only when the Tree List functions in bound mode. This method clears the column collection and creates new columns for all the fields in the Tree List’s bound data source. The TreeListColumn.FieldName property of each column created is set to the respective bound field’s name. The TreeListColumn.Caption property is initialized with field captions. The TreeListColumn.VisibleIndex property is set with respect to the position of fields within the bound data source.

Note if the Tree List’s TreeListOptionsBehavior.PopulateServiceColumns option is active, the PopulateColumns method call creates columns that are bound to fields specified by the TreeList.KeyFieldName, TreeList.ParentFieldName and TreeList.ImageIndexFieldName properties. Otherwise, columns bound to these fields are not created.

To create columns manually, use the methods provided by the TreeList.Columns collection.

The following code snippets (auto-collected from DevExpress Examples) contain references to the PopulateColumns() 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.

See Also