DataGridView.AutoGenerateColumnsMode Property
Gets or sets whether columns should be automatically created for fields of the underlying data source, depending on whether the grid contains any columns. This is a bindable property.
Namespace: DevExpress.Maui.DataGrid
Assembly: DevExpress.Maui.DataGrid.dll
NuGet Package: DevExpress.Maui.DataGrid
Declaration
public AutoGenerateColumnsMode AutoGenerateColumnsMode { get; set; }
Property Value
Type | Description |
---|---|
AutoGenerateColumnsMode | A value that specifies the way columns are generated. |
Available values:
Name | Description |
---|---|
Auto | Creates columns for all fields of a data source if the grid does not contain any columns. |
Add | Creates columns for all fields of a data source, preserving the columns the grid already contains. |
Replace | Creates columns for all fields of a data source, removing columns the grid already contains. |
None | Doesn’t create columns. |
Remarks
Set the AutoGenerateColumnsMode property to None to prevent columns from being automatically created. If you need to cancel the generation of an individual column, use the DataGridView.AutoGeneratingColumn event. This event also allows you to customize an auto-generated column at the time it is created.