Skip to main content

How to: Automatically Create Grid Columns

The following example demonstrates how to automatically populate grid with all columns from its data source. You can use this technique to show all columns from a data source when you don’t need to customize the columns.

Set the DataControlBase.AutoGenerateColumns property to AutoGenerateColumnsMode.AddNew, AutoGenerateColumnsMode.KeepOld, or AutoGenerateColumnsMode.RemoveOld.

View Example

<dxg:GridControl x:Name="grid" ItemsSource="{x:Static local:SimpleData.Numbers}" AutoGenerateColumns="AddNew" />