Skip to main content

HierarchicalExpanderColumn<TModel> Class

Definition

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

A column in an Avalonia.Controls.HierarchicalTreeDataGridSource<T> whose cells show an expander to reveal nested data.

public class HierarchicalExpanderColumn<TModel>

Inheritance: object -> NotifyingBase -> HierarchicalExpanderColumn<TModel>

Implements: IColumn, IColumn<>, IExpanderColumn<>, IUpdateColumnLayout, INotifyPropertyChanged

Constructors

NameDescription
HierarchicalExpanderColumn<TModel>No summary available.

HierarchicalExpanderColumn<TModel> Constructor

public HierarchicalExpanderColumn<TModel>(Avalonia.Controls.Models.TreeDataGrid.IColumn<TModel><TModel> inner, Func<TModel, System.Collections.Generic.IEnumerable<TModel>> childSelector, System.Linq.Expressions.Expression<Func<TModel,bool>> hasChildrenSelector, System.Linq.Expressions.Expression<Func<TModel,bool>> isExpandedSelector)

Parameters

inner Avalonia.Controls.Models.TreeDataGrid.IColumn<TModel><TModel>

childSelector Func<TModel, System.Collections.Generic.IEnumerable<TModel>>

hasChildrenSelector System.Linq.Expressions.Expression<Func<TModel,bool>>

isExpandedSelector System.Linq.Expressions.Expression<Func<TModel,bool>>

Methods

NameDescription
CreateCellNo summary available.
GetChildModelsGets the child models for the specified model.
GetComparisonNo summary available.
HasChildrenDetermines whether the specified model has children.

CreateCell Method

public Avalonia.Controls.Models.TreeDataGrid.ICell CreateCell(Avalonia.Controls.Models.TreeDataGrid.IRow<TModel><TModel> row)

Parameters

row Avalonia.Controls.Models.TreeDataGrid.IRow<TModel><TModel>

Returns

Avalonia.Controls.Models.TreeDataGrid.ICell

GetChildModels Method

Gets the child models for the specified model.

public System.Collections.Generic.IEnumerable<TModel> GetChildModels(TModel model)

Parameters

model TModel

The parent model.

Returns

System.Collections.Generic.IEnumerable<TModel>

The child models, or null if there are no children.

GetComparison Method

public Comparison<TModel> GetComparison(System.ComponentModel.ListSortDirection direction)

Parameters

direction System.ComponentModel.ListSortDirection

Returns

Comparison<TModel>

HasChildren Method

Determines whether the specified model has children.

public bool HasChildren(TModel model)

Parameters

model TModel

The model.

Returns

bool

True if the model has children; otherwise false.

Properties

NameDescription
ActualWidthGets or sets the actual width of the column after measurement.
CanUserResizeGets a value indicating whether the user can resize the column.
HeaderGets the column header.
InnerGets the inner column that is wrapped by this expander column.
IsVisibleGets or sets a value indicating whether the column is visible.
SortDirectionGets or sets the sort direction indicator that will be displayed on the column.
TagGets or sets a user-defined object attached to the column.
WidthGets the width of the column.

ActualWidth Property

Gets or sets the actual width of the column after measurement.

public double ActualWidth { get; set; }

CanUserResize Property

Gets a value indicating whether the user can resize the column.

public Nullable<bool> CanUserResize { get; set; }

Header Property

Gets the column header.

public object Header { get; set; }

Inner Property

Gets the inner column that is wrapped by this expander column.

public Avalonia.Controls.Models.TreeDataGrid.IColumn<TModel><TModel> Inner { get; set; }

IsVisible Property

Gets or sets a value indicating whether the column is visible.

public bool IsVisible { get; set; }

Remarks

When set to false, the column header and cells will not be rendered and the column will not contribute to layout calculations.

SortDirection Property

Gets or sets the sort direction indicator that will be displayed on the column.

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

Remarks

Note that changing this property does not change the sorting of the data, it is only used to display a sort direction indicator. To sort data according to a column use Avalonia.Controls.ITreeDataGridSource.SortBy(Avalonia.Controls.Models.TreeDataGrid.IColumn,System.ComponentModel.ListSortDirection).

Tag Property

Gets or sets a user-defined object attached to the column.

public object Tag { get; set; }

Width Property

Gets the width of the column.

public Avalonia.Controls.GridLength Width { get; set; }

Remarks

To set the column width use Avalonia.Controls.Models.TreeDataGrid.IColumns.SetColumnWidth(int,Avalonia.Controls.GridLength).

Events

NameDescription
PropertyChangedOccurs when a property value changes. Inherited from NotifyingBase.