The requested page is not available for the requested platform. You are viewing the content for Default platform.

DataGridView.AutoGeneratingColumn Event

Occurs each time an individual column is generated automatically.

Namespace: DevExpress.XamarinForms.DataGrid

Assembly: DevExpress.XamarinForms.Grid.dll

Declaration

public event AutoGeneratingColumnEventHandler AutoGeneratingColumn

Event Data

The AutoGeneratingColumn event handler receives an argument of the AutoGeneratingColumnEventArgs type. The following properties provide information specific to this event.

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled.
(Inherited from CancelEventArgs)
Column Gets the column being generated automatically.

Remarks

The grid automatically creates columns based on the bound data source if you do not specify a collection of grid columns (DataGridView.Columns). You can use the DataGridView.AutoGenerateColumnsMode property to prevent columns from being automatically created or set another mode of auto generating columns.

Examples

This example shows how to use the AutoGeneratingColumn event to modify an auto-generated column at the time it is created, or cancel the generation of a column.

<dxg:DataGridView x:Name="grid" ItemsSource="{Binding Employees}" 
                  AutoGenerateColumnsMode="Auto"
                  AutoGeneratingColumn="Grid_AutoGeneratingColumn">
    <!-- ... -->
</dxg:DataGridView>
See Also