Skip to main content

TreeDataGridColumnHeader Class

Definition

Assembly:Avalonia.Controls.TreeDataGrid
Package:Avalonia.Controls.TreeDataGrid

A control which displays a column header in a Avalonia.Controls.TreeDataGrid control.

public class TreeDataGridColumnHeader

Inheritance: Button -> TreeDataGridColumnHeader

Remarks

TreeDataGridColumnHeader is responsible for displaying column headers in a TreeDataGrid and provides functionality for column resizing and sorting.

Column headers can be clicked to sort the data in the TreeDataGrid, and if resizing is enabled, they can be resized by dragging the edge of the header.

This class supports the following pseudo-classes:

  • :resizable - Set when the column can be resized by the user

Constructors

NameDescription
TreeDataGridColumnHeaderNo summary available.

TreeDataGridColumnHeader Constructor

public TreeDataGridColumnHeader()

Properties

NameDescription
CanUserResizeGets a value indicating whether the column can be resized by the user.
ColumnIndexGets the index of the column in the Avalonia.Controls.TreeDataGrid.
HeaderGets the content to display in the column header.
SortDirectionGets the current sort direction of the column.

CanUserResize Property

Gets a value indicating whether the column can be resized by the user.

public bool CanUserResize { get; set; }

Value

true if the column can be resized by the user; otherwise, false.

Remarks

This value is derived from the column model's Avalonia.Controls.TreeDataGridColumn.CanUserResize property and the owning Avalonia.Controls.TreeDataGrid.CanUserResizeColumns property.

ColumnIndex Property

Gets the index of the column in the Avalonia.Controls.TreeDataGrid.

public int ColumnIndex { get; set; }

Value

The zero-based index of the column, or -1 if the column header is not realized.

Header Property

Gets the content to display in the column header.

public object Header { get; set; }

Value

The header content, which can be a string, a data template, or any other object.

Remarks

This value is obtained from the Avalonia.Controls.TreeDataGridColumn.Header property of the column model.

SortDirection Property

Gets the current sort direction of the column.

public Nullable<System.ComponentModel.ListSortDirection> SortDirection { get; set; }

Value

The sort direction (ascending or descending), or null if the column is not sorted.

Remarks

This value is obtained from the Avalonia.Controls.TreeDataGridColumn.SortDirection property of the column model. The sort direction is updated when the user clicks on the column header and sorting is enabled.

Fields

CanUserResizeProperty Field

Defines the Avalonia.Controls.Primitives.TreeDataGridColumnHeader.CanUserResize property.

public Avalonia.DirectProperty<Avalonia.Controls.Primitives.TreeDataGridColumnHeader, bool> CanUserResizeProperty

HeaderProperty Field

Defines the Avalonia.Controls.Primitives.TreeDataGridColumnHeader.Header property.

public Avalonia.DirectProperty<Avalonia.Controls.Primitives.TreeDataGridColumnHeader, object> HeaderProperty

SortDirectionProperty Field

Defines the Avalonia.Controls.Primitives.TreeDataGridColumnHeader.SortDirection property.

public Avalonia.DirectProperty<Avalonia.Controls.Primitives.TreeDataGridColumnHeader, Nullable<System.ComponentModel.ListSortDirection>> SortDirectionProperty