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

ColumnViewOptionsBehavior.AutoPopulateColumns Property

Gets or sets whether columns should be created automatically for all fields in the underlying data source when the View doesn’t contain any columns. When bound to a business object, the grid does not generate columns for properties of collection types.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v18.2.dll

Declaration

[DefaultValue(true)]
[XtraSerializableProperty]
public virtual bool AutoPopulateColumns { get; set; }

Property Value

Type Default Description
Boolean **true**

true, if the columns are created automatically when the View doesn’t contain any columns; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to AutoPopulateColumns
AdvBandedGridView
.OptionsBehavior.AutoPopulateColumns
BandedGridView
.OptionsBehavior.AutoPopulateColumns
ColumnView
.OptionsBehavior.AutoPopulateColumns
CardView
.OptionsBehavior.AutoPopulateColumns
GridView
.OptionsBehavior.AutoPopulateColumns
LayoutView
.OptionsBehavior.AutoPopulateColumns
TileView
.OptionsBehavior.AutoPopulateColumns
WinExplorerView
.OptionsBehavior.AutoPopulateColumns

Remarks

This property determines whether the BaseView.PopulateColumns method is called automatically when a data source is assigned to a View which doesn’t contain any columns. The BaseView.PopulateColumns method creates GridColumn objects for all the fields in the underlying data source and make these columns visible.

Set the AutoPopulateColumns property to false to prevent columns from being automatically created.

Note

A business object bound to a Grid Control may contain properties of collection types (e.g., of the List<> type). These properties instruct the Grid to enable master-detail mode (see Working with Master-Detail Relationships in Code). Columns corresponding to collection properties are not created in a master View.

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

See Also