# Columns Overview

The DataGrid provides a set of approaches for defining its columns.

The following strategies are available:

* Manually—By adding columns to the `RadDataGrid.Columns` collection.
* Automatically—By setting `RadDataGrid.AutoGenerateColumns="True"`.
* Mixed—By adding columns to the `RadDataGrid.Columns` collection and also setting `RadDataGrid.AutoGenerateColumns="True"`.

When `RadDataGrid.AutoGenerateColumns="True"`, the DataGrid generates [column types](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-overview#column-types) depending on the incoming data.

The DataGrid also supports column reordering by default. To enable or disable column reordering, use the `RadDataGrid.UserColumnReorderMode` property.

## Column Types

The DataGrid provides the following type of columns:

* [Template column](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-templatecolumn)—Represents a column that uses a `DataTemplate` to describe the content of each associated grid cell.
* [Boolean column](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-booleancolumn)—A special `DataGridTypedColumn` implementation that presents Boolean data.
* [Date column](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-datecolumn)—An extended `DataGridTextColumn` that presents data of type `DateTime`. The column will create a `DataGridDateFilterControl` upon triggering the filtering UI through user input.
* [Image column](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-imagecolumn)—Represents a specific `DataGridTypedColumn` that may show the associated data through Image controls.
* [Numerical column](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-numericalcolumn)—Represents an extended `DataGridTextColumn` that shows numerical data. The column will create a `DataGridNumericalFilterControl` upon triggering the filtering UI through user input.
* [Text column](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-textcolumn)—Represents a column that converts the content of each associated cell to a `System.String` object.
* [Time column](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-timecolumn)—Represents an extended `DataGridTextColumn` that presents data of type `DateTime`. The column will create a `DataGridTimeFilterControl` upon triggering the filtering UI through user input.
* [ComboBox column](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/datagrid-comboboxcolumn)—An extended `DataGridTextColumn` that uses a ComboBox component to select a value when the cell is in edit mode.

## Key Properties

* `CellDecorationStyle`—Gets or sets the `Style` object that defines the background of each cell associated with this column. The `TargetType` property of the `Style` object is `Rectangle`.
* `CellDecorationStyleSelector`—Gets or sets the `StyleSelector` instance that allows for a dynamic decoration on a per-cell basis.
* [`Header`](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/how-to/datagrid-howto-setheaderstyle)—Gets or sets the content that will be displayed in the header UI, which represents the column.
* [`HeaderStyle`](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/how-to/datagrid-howto-setheaderstyle)—Gets or sets the `Style` instance that defines the appearance of the `DataGridColumnHeader` component.
* [`SizeMode`](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/how-to/datagrid-howto-setcolumnswidthusingsizemode)—Gets or sets the `DataGridColumnSizeMode` value that controls the way the column and its associated cells are sized horizontally.
  * `Fixed`—The column has a fixed width as defined by its `Width` property.
  * `Stretch`—The column is stretched to the available width proportionally to its desired width.
  * `Auto`—The columns is sized to its desired width. That is the maximum desired width of all associated cells.
* [`Width`](https://www.telerik.com/winui/documentation/controls/raddatagrid/columns/how-to/datagrid-howto-setcolumnswidthusingsizemode)—Gets or sets the fixed width for the column. Applicable when the `SizeMode` property is set to `DataGridColumnSizeMode.Fixed`.
* `ActualWidth`—Gets the actual width of the column.
* `IsAutoGenerated`—Gets a value indication whether the column is auto-generated internally.
* `SortDirection`—Gets or sets a value that defines the visual state of the `SortingDirectionGlyph`.

This property is used for visualization purposes only and does not affect the actual sort state of the column. To add sorting to the column, you have to use a [Sort Descriptor](https://www.telerik.com/winui/documentation/controls/raddatagrid/sorting/datagrid-sorting-overview).

* `CanUserEdit` (bool)—Gets or sets a value indicating whether the user can edit the values in this column.
* `CanUserFilter` (bool)—Gets or sets a value indicating whether the user can filter the data by the values in the column using the built-in filtering UI.
* `CanUserGroup` (bool)—Gets or sets a value indicating whether the user can group the data by the values in the column using the built-in grouping UI.
* `CanUserSort` (bool)—Gets or sets a value indicating whether the user can sort the data by the values in the column using the built-in sorting UI.
* `CanUserReorder` (bool)—Gets or sets a value indicating whether the user can reorder the column.
* `IsVisible` (bool)—Gets a value indicating if a specific column will be visualized.
