Skip to main content

FlatTreeDataGridSource<TModel> Class

Definition

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

A data source for a Avalonia.Controls.TreeDataGrid which displays a flat grid.

public class FlatTreeDataGridSource<TModel>

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

Implements: ITreeDataGridSource, ITreeDataGridSource<>, INotifyPropertyChanged, IDisposable

Constructors

NameDescription
FlatTreeDataGridSource<TModel>No summary available.

FlatTreeDataGridSource<TModel> Constructor

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

Parameters

items System.Collections.Generic.IEnumerable<TModel>

Methods

NameDescription
ClearSortClears any sorting applied to the specified column.
DisposeNo summary available.
FilterNo summary available.
RefreshFilterRefreshes the current filter applied to the collection.
SortByRequests to sort the source by the specified column.

ClearSort Method

Clears any sorting applied to the specified column.

public void ClearSort(Avalonia.Controls.Models.TreeDataGrid.IColumn column)

Parameters

column Avalonia.Controls.Models.TreeDataGrid.IColumn

The column.

Dispose Method

public void Dispose()

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.

SortBy Method

Requests to sort the source by the specified column.

public bool SortBy(Avalonia.Controls.Models.TreeDataGrid.IColumn column, System.ComponentModel.ListSortDirection direction)

Parameters

column Avalonia.Controls.Models.TreeDataGrid.IColumn

The column.

direction System.ComponentModel.ListSortDirection

The sort direction.

Returns

bool

True if the sort could be performed; otherwise false.

Properties

NameDescription
CellSelectionGets the cell selection model if cell selection is being used.
ColumnsGets the columns to be displayed.
IsFilteredGets a value indicating whether the data source is filtered.
IsHierarchicalGets a value indicating whether the data source is hierarchical.
IsSortedGets a value indicating whether the data source is currently sorted.
ItemsGets the items in the data source.
RowSelectionGets the row selection model if row selection is being used.
RowsGets the rows to be displayed.
SelectionGets or sets the selection model.

CellSelection Property

Gets the cell selection model if cell selection is being used.

public Avalonia.Controls.Selection.ITreeDataGridCellSelectionModel<T><TModel> CellSelection { get; set; }

Remarks

This property is equivalent to casting the Avalonia.Controls.FlatTreeDataGridSource<T>.Selection property to Avalonia.Controls.Selection.ITreeDataGridCellSelectionModel<T>.

Columns Property

Gets the columns to be displayed.

public Avalonia.Controls.Models.TreeDataGrid.ColumnList<TModel><TModel> Columns { get; set; }

IsFiltered Property

Gets a value indicating whether the data source is filtered.

public bool IsFiltered { get; set; }

IsHierarchical Property

Gets a value indicating whether the data source is hierarchical.

public bool IsHierarchical { get; set; }

IsSorted Property

Gets a value indicating whether the data source is currently sorted.

public bool IsSorted { get; set; }

Items Property

Gets the items in the data source.

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

RowSelection Property

Gets the row selection model if row selection is being used.

public Avalonia.Controls.Selection.ITreeDataGridRowSelectionModel<T><TModel> RowSelection { get; set; }

Remarks

This property is equivalent to casting the Avalonia.Controls.FlatTreeDataGridSource<T>.Selection property to Avalonia.Controls.Selection.ITreeDataGridRowSelectionModel<T>.

Rows Property

Gets the rows to be displayed.

public Avalonia.Controls.Models.TreeDataGrid.IRows Rows { get; set; }

Selection Property

Gets or sets the selection model.

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

Remarks

The selection mode of the control may be changed by setting this property to either an instance of Avalonia.Controls.Selection.TreeDataGridRowSelectionModel<T> for row selection, or Avalonia.Controls.Selection.TreeDataGridCellSelectionModel<T> for cell selection.

Events

NameDescription
SortedOccurs after sorting has changed on the data source.
PropertyChangedOccurs when a property value changes. Inherited from NotifyingBase.

Sorted Event

Occurs after sorting has changed on the data source.

public event Action Sorted