Class
DataGridColumn

Defines an abstraction of a table column that is used to visualize data within a RadDataGrid component. A column generally represents a Property within the underlying ViewModel.

Definition

Namespace:Telerik.UI.Xaml.Controls.Grid

Assembly:Telerik.WinUI.Controls.dll

Syntax:

cs-api-definition
public abstract class DataGridColumn : RadDependencyObject

Inheritance: objectRadDependencyObjectDataGridColumn

Derived Classes: DataGridTemplateColumnDataGridTypedColumn

Constructors

DataGridColumn()

Initializes a new instance of the DataGridColumn class.

Declaration

cs-api-definition
protected DataGridColumn()

Fields

AggregatesTemplateProperty

Identifies the AggregatesTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty AggregatesTemplateProperty

Field Value

DependencyProperty

CanUserEditProperty

Identifies the CanUserEdit dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanUserEditProperty

Field Value

DependencyProperty

CanUserFilterProperty

Identifies the CanUserFilter dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanUserFilterProperty

Field Value

DependencyProperty

CanUserGroupProperty

Identifies the CanUserGroup dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanUserGroupProperty

Field Value

DependencyProperty

CanUserReorderProperty

Identifies the CanUserReorder dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanUserReorderProperty

Field Value

DependencyProperty

CanUserResizeProperty

Identifies the CanUserResize dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanUserResizeProperty

Field Value

DependencyProperty

CanUserSortProperty

Identifies the CanUserSort dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanUserSortProperty

Field Value

DependencyProperty

CellDecorationStyleProperty

Identifies the CellDecorationStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CellDecorationStyleProperty

Field Value

DependencyProperty

CellDecorationStyleSelectorProperty

Identifies the CellDecorationStyleSelector dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CellDecorationStyleSelectorProperty

Field Value

DependencyProperty

DataOperationsFlyoutTemplateProperty

Identifies the DataOperationsFlyoutTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DataOperationsFlyoutTemplateProperty

Field Value

DependencyProperty

HeaderProperty

Identifies the Header dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty HeaderProperty

Field Value

DependencyProperty

HeaderStyleProperty

Identifies the HeaderStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty HeaderStyleProperty

Field Value

DependencyProperty

IsCellFlyoutEnabledProperty

Identifies the IsCellFlyoutEnabled dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsCellFlyoutEnabledProperty

Field Value

DependencyProperty

IsVisibleProperty

Identifies the IsVisible dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsVisibleProperty

Field Value

DependencyProperty

NameProperty

Identifies the Name dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty NameProperty

Field Value

DependencyProperty

SizeModeProperty

Identifies the SizeMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SizeModeProperty

Field Value

DependencyProperty

SortDirectionProperty

Identifies the SortDirection dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SortDirectionProperty

Field Value

DependencyProperty

WidthProperty

Identifies the Width dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty WidthProperty

Field Value

DependencyProperty

Properties

ActualWidth

Gets the actual width of the column.

Declaration

cs-api-definition
public double ActualWidth { get; }

Property Value

double

AggregatesTemplate

Gets or sets the template used to show aggregates

Declaration

cs-api-definition
public DataTemplate AggregatesTemplate { get; set; }

Property Value

DataTemplate

CanUserEdit

Gets or sets a value indicating whether the user can edit this column.

Declaration

cs-api-definition
public bool CanUserEdit { get; set; }

Property Value

bool

The default value is "true".

Remarks

To enable/disable editing in RadDataGrid see the

CanUserFilter

Gets or sets a value indicating whether the user can filter this column by using the built-in filtering UI.

Declaration

cs-api-definition
public bool CanUserFilter { get; set; }

Property Value

bool

The default value is "true".

Remarks

To enable/disable Filtering in RadDataGrid see the

CanUserGroup

Gets or sets a value indicating whether the user can group-by this column by using the built-in Grouping UI.

Declaration

cs-api-definition
public bool CanUserGroup { get; set; }

Property Value

bool

The default value is "true".

Remarks

To enable/disable grouping in RadDataGrid see the .

CanUserReorder

Gets or sets a value indicating whether the user can reorder the column.

Declaration

cs-api-definition
public bool CanUserReorder { get; set; }

Property Value

bool

The default value is "true".

Remarks

To enable/disable column reordering see the

CanUserResize

Gets or sets a value indicating whether the user can resize this column.

Declaration

cs-api-definition
public bool CanUserResize { get; set; }

Property Value

bool

The default value is "true".

Remarks

To enable/disable editing in RadDataGrid see the

CanUserSort

Gets or sets a value indicating whether the user can sort the data by the values in this column.

Declaration

cs-api-definition
public bool CanUserSort { get; set; }

Property Value

bool

The default value is "true".

Remarks

To enable/disable sorting in RadDataGrid see the .

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 .

Declaration

cs-api-definition
public Style CellDecorationStyle { get; set; }

Property Value

Style

CellDecorationStyleSelector

Gets or sets the StyleSelector instance that allows for dynamic decoration on a per cell basis.

Declaration

cs-api-definition
public StyleSelector CellDecorationStyleSelector { get; set; }

Property Value

StyleSelector

DataOperationsFlyoutTemplate

Gets or sets the DataTemplate for the DataOperations' flyout.

Declaration

cs-api-definition
public DataTemplate DataOperationsFlyoutTemplate { get; set; }

Property Value

DataTemplate

Header

Gets or sets the content to be displayed in the Header UI that represents the column.

Declaration

cs-api-definition
public object Header { get; set; }

Property Value

object

HeaderStyle

Gets or sets the Style instance that defines the appearance of the DataGridColumnHeader control.

Declaration

cs-api-definition
public Style HeaderStyle { get; set; }

Property Value

Style

IsAutoGenerated

Gets a value indicating whether the column is auto-generated internally.

Declaration

cs-api-definition
public bool IsAutoGenerated { get; }

Property Value

bool

IsCellFlyoutEnabled

Gets or sets a value indicating whether a flyout will be shown over a cell after holding.

Declaration

cs-api-definition
public bool IsCellFlyoutEnabled { get; set; }

Property Value

bool

IsVisible

Gets or sets a value indicating whether if the current column is visible or not.

Declaration

cs-api-definition
public bool IsVisible { get; set; }

Property Value

bool

Name

Gets or sets the unique name of the column. Typically this is used as an identifier for this particular instance. This value is used by the string indexer in the Columns collection.

Declaration

cs-api-definition
public string Name { get; set; }

Property Value

string

Example

xaml
<telerikGrid:RadDataGrid x:Name="grid">
  <telerikGrid:RadDataGrid.Columns>
    <telerikGrid:DataGridTextColumn Name="FirstColumn"/>
  </telerikGrid:RadDataGrid.Columns>
</telerikGrid:RadDataGrid>
c
this.grid.Columns[0].Name = "FirstColumn";

SizeMode

Gets or sets the DataGridColumnSizeMode value that controls how the column and its associated cells are sized horizontally.

Declaration

cs-api-definition
public DataGridColumnSizeMode SizeMode { get; set; }

Property Value

DataGridColumnSizeMode

SortDirection

Gets or sets the current SortDirection value for the column. This property is used for visualization purposes only and does not affect the actual sorting state of the owning RadDataGrid component.

Declaration

cs-api-definition
public SortDirection SortDirection { get; set; }

Property Value

SortDirection

SupportsCompositeFilter

When overriden in an inherited column gets a value whether this column shows two filter controls in its filtering flyout.

Declaration

cs-api-definition
protected virtual bool SupportsCompositeFilter { get; }

Property Value

bool

Width

Gets or sets the fixed width for the column. Applicable when the SizeMode property is set to DataGridColumnSizeMode.Fixed.

Declaration

cs-api-definition
public double Width { get; set; }

Property Value

double

Methods

ClearCell(object)

Clears the bindings, data etc. of the control visualized by the cell when it is not edited.

Declaration

cs-api-definition
public virtual void ClearCell(object container)

Parameters

container

object

The container visualizing the cell data when it is not edited.

CreateContainer(object)

Creates an instance of the control visualized when the column is not edited.

Declaration

cs-api-definition
public abstract object CreateContainer(object rowItem)

Parameters

rowItem

object

Returns

object

An instance of the control.

CreateDecorationContainer(object)

Creates a FrameworkElement instance that will be used as a decoration container for the cell represented by the specified row item and the current column instance.

Declaration

cs-api-definition
protected virtual FrameworkElement CreateDecorationContainer(object rowItem)

Parameters

rowItem

object

The row item the cell belongs to.

Returns

FrameworkElement

CreateFilterControl()

Creates the appropriate DataGridFilterControlBase instance that allows filtering operation to be applied upon this column.

Declaration

cs-api-definition
protected abstract DataGridFilterControlBase CreateFilterControl()

Returns

DataGridFilterControlBase

GetContainerType(object)

Gets the type of the control visualized when the cell is not currently edited.

Declaration

cs-api-definition
public abstract object GetContainerType(object rowItem)

Parameters

rowItem

object

Returns

object

The type of the control.

GetEditorType(object)

Gets the type of the editor that is visualized when entering in edit mode.

Declaration

cs-api-definition
public abstract object GetEditorType(object item)

Parameters

item

object

Returns

object

The type of the editor.

GetValueForInstance(object)

Retrieves the column value for the provided object instance. This actually represents the content of a grid cell where a cell is defined by a row (data item) and a column.

Declaration

cs-api-definition
public virtual object GetValueForInstance(object instance)

Parameters

instance

object

Returns

object

PrepareCell(object, object, object)

Prepares the control visualized by the cell when it is not edited.

Declaration

cs-api-definition
public abstract void PrepareCell(object container, object value, object item)

Parameters

container

object

The container visualizing the cell data when it is not edited.

value

object

The value of the cell.

item

object

The item visualized in the cell.

UpdateFilterVisualState(bool)

Method that updates the VisualState of the Header after filtering.

Declaration

cs-api-definition
public void UpdateFilterVisualState(bool isFiltered)

Parameters

isFiltered

bool