wpf-devexpress-dot-xpf-dot-grid-dot-datacontrolbase-189b4a92.md
Gets or sets a template that describes grid columns. This is a dependency property.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public DataTemplate ColumnGeneratorTemplate { get; set; }
Public Property ColumnGeneratorTemplate As DataTemplate
| Type | Description |
|---|---|
| DataTemplate |
The column template.
|
You can define columns in a ViewModel and display them in the GridControl. To do this, follow the steps below:
Create a collection of grid columns in a ViewModel.
Specify a data template that generates columns:
Assign the column collection to the ColumnsSource property and the column template to the ColumnGeneratorTemplate property:
If you have multiple column templates, use the ColumnGeneratorTemplateSelector property to specify a template selector that chooses a template based on a column type.
Refer to the following help topic for more information: How to: Bind the Grid to a Collection of Columns.
See Also