How to: Automatically Create Grid Columns
The following example demonstrates how to automatically populate a grid with all the columns from its data source. This might be required, when it is necessary to show all columns from a data source, and no specific options should be defined for any column.
To accomplish this task, simply set the DataControlBase.AutoGenerateColumns property to AutoGenerateColumnsMode.AddNew, AutoGenerateColumnsMode.KeepOld or AutoGenerateColumnsMode.RemoveOld.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-automatically-create-columns-for-all-fields-in-a-grids-datasource-e1521.
<dxg:GridControl x:Name="grid" ItemsSource="{x:Static local:SimpleData.Numbers}" AutoGenerateColumns="AddNew" />