Skip to main content

ColumnViewOptionsBehavior.AutoPopulateColumns Property

Gets or sets whether to create columns automatically for all fields in the underlying data source (when binding the grid and if the View doesn’t contain any columns). When bound to a data source, the grid does not generate columns for properties of collection types.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v22.1.dll

NuGet Package: DevExpress.Win.Grid

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.

See Also