Skip to main content

TreeDataGridRowHeaderColumn Class

Definition

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

A column that displays visual row numbers (0, 1, 2...).

public class TreeDataGridRowHeaderColumn

Inheritance: AvaloniaObject -> TreeDataGridColumn -> TreeDataGridRowHeaderColumn

Remarks

The Avalonia.Controls.TreeDataGridRowHeaderColumn class provides a column type that displays visual row numbers. The numbers always represent the visual position of each row, remaining sequential regardless of sorting or whether the data source is flat or hierarchical.

This column type is designed to be explicitly added by users to their columns collection:

var source = new FlatTreeDataGridSource<Person>(people);
source.Columns.Add(new RowHeaderColumn());
source.Columns.Add(TextColumn.Create<Person, string>("Name", x => x.Name));

// Freeze the row header column if desired
treeDataGrid.FrozenColumnCount = 1;

Row header columns are read-only, do not support sorting, and are not user-resizable.

Constructors

NameDescription
TreeDataGridRowHeaderColumn (2 overloads)Initializes a new instance of the Avalonia.Controls.TreeDataGridRowHeaderColumn class with default settings.

TreeDataGridRowHeaderColumn overloads

TreeDataGridRowHeaderColumn Constructor

Initializes a new instance of the Avalonia.Controls.TreeDataGridRowHeaderColumn class with default settings.

public TreeDataGridRowHeaderColumn()
Remarks

Creates a row header column with no header text and a default width of 50 pixels.

TreeDataGridRowHeaderColumn Constructor

public TreeDataGridRowHeaderColumn(object header, Nullable<Avalonia.Controls.GridLength> width)
Parameters

header object

width Nullable<Avalonia.Controls.GridLength>

Properties

NameDescription
ActualWidthGets the actual width of the column after measurement. Inherited from TreeDataGridColumn.
AllowTriStateSortingGets or sets whether the user can cycle through ascending, descending, and unsorted states when clicking the column header. Inherited from TreeDataGridColumn.
BeginEditGesturesGets or sets the gesture(s) that will cause a cell to enter edit mode. Inherited from TreeDataGridColumn.
CanUserResizeGets or sets a value indicating whether the user can resize the column by dragging. Inherited from TreeDataGridColumn.
CanUserSortColumnGets or sets a value indicating whether the user can sort the column by clicking. Inherited from TreeDataGridColumn.
CompareAscendingGets or sets a custom comparison for ascending sort order. Inherited from TreeDataGridColumn.
CompareDescendingGets or sets a custom comparison for descending sort order. Inherited from TreeDataGridColumn.
HeaderGets or sets the column header. Inherited from TreeDataGridColumn.
IsVisibleGets or sets a value indicating whether the column is visible. Inherited from TreeDataGridColumn.
MaxWidthGets or sets the maximum width for the column. Inherited from TreeDataGridColumn.
MinWidthGets or sets the minimum width for the column. Inherited from TreeDataGridColumn.
SortDirectionGets or sets the sort direction indicator that will be displayed on the column. Inherited from TreeDataGridColumn.
TagGets or sets a user-defined object attached to the column. Inherited from TreeDataGridColumn.
WidthGets or sets the width of the column. Inherited from TreeDataGridColumn.

Fields

NameDescription
ActualWidthPropertyDefines the Avalonia.Controls.TreeDataGridColumn.ActualWidth property. Inherited from TreeDataGridColumn.
AllowTriStateSortingPropertyDefines the Avalonia.Controls.TreeDataGridColumn.AllowTriStateSorting property. Inherited from TreeDataGridColumn.
BeginEditGesturesPropertyDefines the Avalonia.Controls.TreeDataGridColumn.BeginEditGestures property. Inherited from TreeDataGridColumn.
CanUserResizePropertyDefines the Avalonia.Controls.TreeDataGridColumn.CanUserResize property. Inherited from TreeDataGridColumn.
CanUserSortColumnPropertyDefines the Avalonia.Controls.TreeDataGridColumn.CanUserSortColumn property. Inherited from TreeDataGridColumn.
CompareAscendingPropertyDefines the Avalonia.Controls.TreeDataGridColumn.CompareAscending property. Inherited from TreeDataGridColumn.
CompareDescendingPropertyDefines the Avalonia.Controls.TreeDataGridColumn.CompareDescending property. Inherited from TreeDataGridColumn.
HeaderPropertyDefines the Avalonia.Controls.TreeDataGridColumn.Header property. Inherited from TreeDataGridColumn.
IsVisiblePropertyDefines the Avalonia.Controls.TreeDataGridColumn.IsVisible property. Inherited from TreeDataGridColumn.
MaxWidthPropertyDefines the Avalonia.Controls.TreeDataGridColumn.MaxWidth property. Inherited from TreeDataGridColumn.
MinWidthPropertyDefines the Avalonia.Controls.TreeDataGridColumn.MinWidth property. Inherited from TreeDataGridColumn.
SortDirectionPropertyDefines the Avalonia.Controls.TreeDataGridColumn.SortDirection property. Inherited from TreeDataGridColumn.
TagPropertyDefines the Avalonia.Controls.TreeDataGridColumn.Tag property. Inherited from TreeDataGridColumn.
WidthPropertyDefines the Avalonia.Controls.TreeDataGridColumn.Width property. Inherited from TreeDataGridColumn.