Skip to main content

ColumnBase<TModel> Class

Definition

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

Base class for columns which select cell values from a model.

public class ColumnBase<TModel>

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

Implements: IColumn, IColumn<>, IUpdateColumnLayout, INotifyPropertyChanged

Constructors

NameDescription
ColumnBase<TModel>No summary available.

ColumnBase<TModel> Constructor

public ColumnBase<TModel>(object header, Nullable<Avalonia.Controls.GridLength> width, Avalonia.Controls.Models.TreeDataGrid.ColumnOptions<TModel><TModel> options)

Parameters

header object

width Nullable<Avalonia.Controls.GridLength>

options Avalonia.Controls.Models.TreeDataGrid.ColumnOptions<TModel><TModel>

Methods

NameDescription
CreateCellNo summary available.
GetComparisonNo summary available.

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

GetComparison Method

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

Parameters

direction System.ComponentModel.ListSortDirection

Returns

Comparison<TModel>

Properties

NameDescription
ActualWidthGets the actual width of the column after measurement.
HeaderGets or sets the column header.
IsVisibleGets or sets a value indicating whether the column is visible.
OptionsGets the column options.
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 the actual width of the column after measurement.

public double ActualWidth { get; set; }

Header Property

Gets or sets the column header.

public object Header { 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.

Options Property

Gets the column options.

public Avalonia.Controls.Models.TreeDataGrid.ColumnOptions<TModel><TModel> Options { get; set; }

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.