Gets or sets a value indicating whether columns should automatically be created when the grid is bound to an ItemsSource.
| Visual Basic (Declaration) | |
|---|---|
Public Property AutoCreateColumns As Boolean | |
| C# | |
|---|---|
public bool AutoCreateColumns {get; set;} | |
Return Value
true if columns should automatically be created when the grid is bound to an items source; false if columns are to be created manually. By default, true.When binding a grid to a DataGridCollectionView or DataGridCollectionViewSource (in XAML), it is recommended to use the ItemProperties property to add or remove the columns the will end up in the Columns collection and leave the AutoCreateColumns property to true.
Cell editors need to be explicitly provided for each column in order to support insertion when AutoCreateColumns is set to false (see Column.CellEditor property).
Supported Frameworks: Microsoft .NET Framework version 3.5