Skip to main content

TreeDataGridColumnHeadersPresenter Class

Definition

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

Presents and manages column headers in a Avalonia.Controls.TreeDataGrid control.

public class TreeDataGridColumnHeadersPresenter

Inheritance: TreeDataGridColumnarPresenterBase<IColumn> -> TreeDataGridColumnHeadersPresenter

Remarks

TreeDataGridColumnHeadersPresenter is responsible for creating, recycling, and arranging column headers horizontally at the top of a TreeDataGrid. It handles the virtualization of column headers, ensuring that only visible headers are realized in the visual tree to improve performance.

This presenter coordinates with the Avalonia.Controls.Models.TreeDataGrid.IColumns collection to manage column widths, measurement, and layout. It also handles column resizing by committing the actual column widths during arrangement.

Constructors

NameDescription
TreeDataGridColumnHeadersPresenterNo summary available.

TreeDataGridColumnHeadersPresenter Constructor

public TreeDataGridColumnHeadersPresenter()

Methods

NameDescription
GetChildIndexGets the index of a logical child element.
TryGetTotalCountNo summary available.

GetChildIndex Method

Gets the index of a logical child element.

public int GetChildIndex(Avalonia.LogicalTree.ILogical child)

Parameters

child Avalonia.LogicalTree.ILogical

The logical child element.

Returns

int

The index of the child element, or -1 if the element is not a column header or is not found.

Remarks

This method is part of the Avalonia.LogicalTree.IChildIndexProvider interface implementation, which allows the presenter to provide indices for its logical children.

TryGetTotalCount Method

public bool TryGetTotalCount(int& count)

Parameters

count int&

Returns

bool

Properties

NameDescription
FrozenColumnCountGets or sets the number of frozen columns.

FrozenColumnCount Property

Gets or sets the number of frozen columns.

public int FrozenColumnCount { get; set; }

Remarks

Frozen columns do not scroll horizontally and remain visible at all times.

Fields

FrozenColumnCountProperty Field

Defines the Avalonia.Controls.Primitives.TreeDataGridColumnHeadersPresenter.FrozenColumnCount property.

public Avalonia.StyledProperty<int> FrozenColumnCountProperty

Events

NameDescription
ChildIndexChangedOccurs when the index of a child element in the presenter changes.

ChildIndexChanged Event

Occurs when the index of a child element in the presenter changes.

public event EventHandler<Avalonia.LogicalTree.ChildIndexChangedEventArgs> ChildIndexChanged

Remarks

This event is raised when column headers are realized, unrealized, or when their indices change due to column insertions or removals.