Back to Devexpress

DataControlBase.EnableSmartColumnsGeneration Property

wpf-devexpress-dot-xpf-dot-grid-dot-datacontrolbase-3cddb60b.md

latest4.6 KB
Original Source

DataControlBase.EnableSmartColumnsGeneration Property

Gets or sets whether to enable smart columns generation feature. This is a dependency property.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public bool EnableSmartColumnsGeneration { get; set; }
vb
Public Property EnableSmartColumnsGeneration As Boolean

Property Value

TypeDescription
Boolean

true to enable smart columns generation feature; otherwise, false.

|

Remarks

If the EnableSmartColumnsGeneration property is set to true , the grid automatically configures columns according to information specified in the underlying data source using Data Annotation Attributes and DevExpress Fluent API.

View Example: Apply Data Annotations

Refer to the Smart Columns Generation topic for a complete list of supported data types and corresponding data editors.

The following code snippets (auto-collected from DevExpress Examples) contain references to the EnableSmartColumnsGeneration property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-implement-drag-and-drop-between-gridcontrols-t566656/CS/MainWindow.xaml#L12

xml
<dxg:GridControl Name="gridControl1" AutoGenerateColumns="AddNew" EnableSmartColumnsGeneration="True">
    <dxg:GridControl.View>

wpf-grid-sync-isnodeexpanded-with-view-model/CS/DevExpress.Example04/MainWindow.xaml#L41

xml
<dxg:GridControl Grid.Row="2" AutoGenerateColumns="AddNew" x:Name="parents"
                EnableSmartColumnsGeneration="True" ItemsSource="{Binding Parents}">
    <dxg:GridControl.View>

wpf-use-devexpress-theme-in-applications/CS/DevExpress.Examples.ThemeSwitcher/MainWindow.xaml#L27

xml
<dxg:GridControl Grid.Row="1" AutoGenerateColumns="AddNew" x:Name="dxGrid" EnableSmartColumnsGeneration="True">
    <dxg:GridControl.View>

how-to-create-search-window-with-find-previous-and-find-next-buttons-in-gridcontrol-t127527/CS/DevExpress.Example01/MainWindow.xaml#L17

xml
dx:ThemeManager.Theme="{Binding ElementName=themes, Path=SelectedItem}"
             EnableSmartColumnsGeneration="True" ItemsSource="{Binding Items}">
<mvvm:Interaction.Behaviors>

how-to-customize-drop-marker-t568780/CS/MainWindow.xaml#L21

xml
</Window.Resources>
<dxg:GridControl Name="gridControl" AutoGenerateColumns="AddNew" EnableSmartColumnsGeneration="True">
    <dxg:GridControl.View>

See Also

IsSmart

Data Annotation Attributes

DataControlBase Class

DataControlBase Members

DevExpress.Xpf.Grid Namespace