Back to Devexpress

DataGridView.AutoGenerateColumnsMode Property

maui-devexpress-dot-maui-dot-datagrid-dot-datagridview-87ed46f7.md

latest1.8 KB
Original Source

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

csharp
public AutoGenerateColumnsMode AutoGenerateColumnsMode { get; set; }

Property Value

TypeDescription
AutoGenerateColumnsMode

A value that specifies the way columns are generated.

|

Available values:

NameDescription
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.

See Also

DataGridView Class

DataGridView Members

DevExpress.Maui.DataGrid Namespace