Skip to main content

HierarchicalTreeDataGridSource<TModel> Class

Definition

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

A data source for a Avalonia.Controls.TreeDataGrid which displays a hierarchial tree where each row may have multiple columns.

public class HierarchicalTreeDataGridSource<TModel>

Inheritance: TreeDataGridSource<> -> HierarchicalTreeDataGridSource<TModel>

Implements: IDisposable, bi<>

Constructors

NameDescription
HierarchicalTreeDataGridSource<TModel> (2 overloads)No summary available.

HierarchicalTreeDataGridSource<TModel> overloads

HierarchicalTreeDataGridSource<TModel> Constructor

public HierarchicalTreeDataGridSource<TModel>(System.Collections.Generic.IEnumerable<TModel> items)
Parameters

items System.Collections.Generic.IEnumerable<TModel>

HierarchicalTreeDataGridSource<TModel> Constructor

Initializes a new instance of the Avalonia.Controls.HierarchicalTreeDataGridSource<T> class with a single root item.

public HierarchicalTreeDataGridSource<TModel>(TModel item)
Parameters

item TModel

The root item to display.

Methods

NameDescription
ClearSortNo summary available.
CollapseCollapses the row at the specified index.
CollapseAllCollapses all rows.
DisposeNo summary available.
ExpandExpands the row at the specified index.
ExpandAllExpands all rows.
ExpandCollapseRecursive (2 overloads)No summary available.
FilterNo summary available.
RefreshFilterRefreshes the current filter applied to the collection.
SortNo summary available.
SortByNo summary available.
TryGetModelAtNo summary available.

ClearSort Method

public void ClearSort(Avalonia.Controls.TreeDataGridColumn column)

Parameters

column Avalonia.Controls.TreeDataGridColumn

Collapse Method

Collapses the row at the specified index.

public void Collapse(Avalonia.Controls.IndexPath index)

Parameters

index Avalonia.Controls.IndexPath

The index path of the row to collapse.

CollapseAll Method

Collapses all rows.

public void CollapseAll()

Dispose Method

public void Dispose()

Expand Method

Expands the row at the specified index.

public void Expand(Avalonia.Controls.IndexPath index)

Parameters

index Avalonia.Controls.IndexPath

The index path of the row to expand.

ExpandAll Method

Expands all rows.

public void ExpandAll()

ExpandCollapseRecursive overloads

ExpandCollapseRecursive Method

public void ExpandCollapseRecursive(Avalonia.Controls.Models.ITreeDataGridRowModel row, Func<TModel, bool> predicate)
Parameters

row Avalonia.Controls.Models.ITreeDataGridRowModel

predicate Func<TModel, bool>

ExpandCollapseRecursive Method

public void ExpandCollapseRecursive(Func<TModel, bool> predicate)
Parameters

predicate Func<TModel, bool>

Filter Method

public void Filter(Func<TModel, bool> filter)

Parameters

filter Func<TModel, bool>

RefreshFilter Method

Refreshes the current filter applied to the collection.

public void RefreshFilter()

Remarks

Call this method if the filter predicate depends on external state which has changed, to re-apply the filter to the collection.

Sort Method

public void Sort(Comparison<TModel> comparison)

Parameters

comparison Comparison<TModel>

SortBy Method

public bool SortBy(Avalonia.Controls.TreeDataGridColumn column, System.ComponentModel.ListSortDirection direction)

Parameters

column Avalonia.Controls.TreeDataGridColumn

direction System.ComponentModel.ListSortDirection

Returns

bool

TryGetModelAt Method

public bool TryGetModelAt(Avalonia.Controls.IndexPath index, TModel& result)

Parameters

index Avalonia.Controls.IndexPath

result TModel&

Returns

bool

Properties

NameDescription
ColumnsGets the columns to be displayed.
IsFilteredNo summary available.
IsHierarchicalNo summary available.
IsSortedNo summary available.
ItemsNo summary available.
RowsNo summary available.
SelectionNo summary available.

Columns Property

Gets the columns to be displayed.

public Avalonia.Controls.TreeDataGridColumns Columns { get; set; }

IsFiltered Property

public bool IsFiltered { get; set; }

IsHierarchical Property

public bool IsHierarchical { get; set; }

IsSorted Property

public bool IsSorted { get; set; }

Items Property

public System.Collections.Generic.IEnumerable<TModel> Items { get; set; }

Rows Property

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

Selection Property

public Avalonia.Controls.Selection.TreeDataGridSelectionModel Selection { get; set; }

Events

NameDescription
RowCollapsedOccurs when a hierarchical row is collapsed.
RowCollapsingOccurs when a hierarchical row is about to collapse.
RowExpandedOccurs when a row in the hierarchical data structure is expanded.
RowExpandingOccurs when a row in the hierarchical data structure is about to expand.

RowCollapsed Event

Occurs when a hierarchical row is collapsed.

public event EventHandler<Avalonia.Controls.Models.TreeDataGridRowModelEventArgs> RowCollapsed

RowCollapsing Event

Occurs when a hierarchical row is about to collapse.

public event EventHandler<Avalonia.Controls.Models.TreeDataGridRowModelEventArgs> RowCollapsing

RowExpanded Event

Occurs when a row in the hierarchical data structure is expanded.

public event EventHandler<Avalonia.Controls.Models.TreeDataGridRowModelEventArgs> RowExpanded

RowExpanding Event

Occurs when a row in the hierarchical data structure is about to expand.

public event EventHandler<Avalonia.Controls.Models.TreeDataGridRowModelEventArgs> RowExpanding