Skip to main content

TreeDataGridCellsPresenter Class

Definition​

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

Presents and manages cells within a row of a Avalonia.Controls.TreeDataGrid control.

public class TreeDataGridCellsPresenter

Inheritance: TreeDataGridColumnarPresenterBase<TreeDataGridColumn> -> TreeDataGridCellsPresenter

Remarks​

TreeDataGridCellsPresenter is responsible for creating, recycling, and arranging cells horizontally within a row of a TreeDataGrid. It handles the virtualization of cells, ensuring that only visible cells are realized in the visual tree to improve performance.

This presenter is typically used within a Avalonia.Controls.Primitives.TreeDataGridRow control template to display the cells for that row. It coordinates with its parent row and the TreeDataGrid to manage cell lifecycle, selection state, and layout.

Constructors​

NameDescription
TreeDataGridCellsPresenterNo summary available.

TreeDataGridCellsPresenter Constructor​

public TreeDataGridCellsPresenter()

Methods​

NameDescription
GetChildIndexGets child's actual index in order of the original source.
RenderNo summary available.
TryGetTotalCountNo summary available.

GetChildIndex Method​

Gets child's actual index in order of the original source.

public int GetChildIndex(Avalonia.LogicalTree.ILogical child)

Parameters​

child Avalonia.LogicalTree.ILogical

Logical child.

Returns​

int

Index or -1 if child was not found.

Render Method​

public void Render(Avalonia.Media.DrawingContext context)

Parameters​

context Avalonia.Media.DrawingContext

TryGetTotalCount Method​

public bool TryGetTotalCount(int& count)

Parameters​

count int&

Returns​

bool

Properties​

NameDescription
FrozenColumnCountGets or sets the number of frozen columns.
GridLinesVisibilityGets or sets a value indicating which grid lines are drawn by the presenter.
RowIndexGets the index of the row that this presenter is currently displaying.
RowsGets or sets the rows collection from which to obtain cell data.

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.

GridLinesVisibility Property​

Gets or sets a value indicating which grid lines are drawn by the presenter.

public Avalonia.Controls.TreeDataGridGridLinesVisibility GridLinesVisibility { get; set; }

Remarks​

This property is usually bound to Avalonia.Controls.TreeDataGrid.GridLinesVisibility by the row control template. Grid lines are drawn using the TreeDataGridLineBrush theme resource.

RowIndex Property​

Gets the index of the row that this presenter is currently displaying.

public int RowIndex { get; set; }

Value​

The zero-based row index, or -1 if the presenter is not realized.

Rows Property​

Gets or sets the rows collection from which to obtain cell data.

public Avalonia.Controls.TreeDataGridRows Rows { get; set; }

Value​

The collection of rows used to populate cells in this presenter.

Fields​

FrozenColumnCountProperty Field​

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

public Avalonia.StyledProperty<int> FrozenColumnCountProperty

GridLinesVisibilityProperty Field​

Defines the Avalonia.Controls.Primitives.TreeDataGridCellsPresenter.GridLinesVisibility property.

public Avalonia.StyledProperty<Avalonia.Controls.TreeDataGridGridLinesVisibility> GridLinesVisibilityProperty

RowsProperty Field​

Defines the Avalonia.Controls.Primitives.TreeDataGridCellsPresenter.Rows property.

public Avalonia.DirectProperty<Avalonia.Controls.Primitives.TreeDataGridCellsPresenter, Avalonia.Controls.TreeDataGridRows> RowsProperty

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