DataControlBase.AutoGenerateColumns Property
In This Article
Gets or sets whether columns should be created automatically for all fields in a data source. This is a dependency property.
Namespace: DevExpress.WinUI.Grid
Assembly: DevExpress.WinUI.Grid.v23.2.dll
NuGet Package: DevExpress.WinUI
#Declaration
[DP(true, Handler = "OnAutoGenerateColumnsChanged")]
public bool AutoGenerateColumns { get; set; }
#Property Value
Type | Description |
---|---|
Boolean | true, to automatically create columns for all fields in a data source; otherwise, false. |
#Remarks
If the AutoGenerateColumns property is set to true, the GridControl creates columns for all fields in a data source and adds them to the DataControlBase.Columns collection.
Follow the steps below to manually add columns to the GridControl:
- Set the AutoGenerateColumns property to false.
- Add ColumnBase descendants to the DataControlBase.Columns collection.
- Specify the ColumnBase.FieldName property for each column.
See Also