Skip to main content

CheckBoxColumn<TModel> Class

Definition

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

A column in an Avalonia.Controls.ITreeDataGridSource which displays a check box.

public class CheckBoxColumn<TModel>

Inheritance: ColumnBase<,Nullable<bool>> -> CheckBoxColumn<TModel>

Remarks

The Avalonia.Controls.Models.TreeDataGrid.CheckBoxColumn<T> class provides a column that displays boolean values as checkboxes in a TreeDataGrid. It supports both two-state (checked/unchecked) and three-state (checked/unchecked/indeterminate) checkbox behavior.

This column creates Avalonia.Controls.Models.TreeDataGrid.CheckBoxCell instances for each row, which are backed by Avalonia.Controls.Primitives.TreeDataGridCheckBoxCell primitive controls that handle the UI rendering and user interactions.

The column can be configured to be read-only by not providing a setter function, and additional options can be specified through Avalonia.Controls.Models.TreeDataGrid.CheckBoxColumnOptions<T>.

Constructors

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

CheckBoxColumn<TModel> overloads

CheckBoxColumn<TModel> Constructor

public CheckBoxColumn<TModel>(object header, System.Linq.Expressions.Expression<Func<TModel,bool>> getter, Action<TModel, bool> setter, Nullable<Avalonia.Controls.GridLength> width, Avalonia.Controls.Models.TreeDataGrid.CheckBoxColumnOptions<TModel><TModel> options)
Parameters

header object

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

setter Action<TModel, bool>

width Nullable<Avalonia.Controls.GridLength>

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

CheckBoxColumn<TModel> Constructor

public CheckBoxColumn<TModel>(object header, System.Linq.Expressions.Expression<Func<TModel,Nullable<bool>>> getter, Action<TModel, Nullable<bool>> setter, Nullable<Avalonia.Controls.GridLength> width, Avalonia.Controls.Models.TreeDataGrid.CheckBoxColumnOptions<TModel><TModel> options)
Parameters

header object

getter System.Linq.Expressions.Expression<Func<TModel,Nullable<bool>>>

setter Action<TModel, Nullable<bool>>

width Nullable<Avalonia.Controls.GridLength>

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

Methods

NameDescription
CreateCellNo 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

Properties

NameDescription
IsThreeStateGets a value indicating whether the column displays a three-state checkbox.

IsThreeState Property

Gets a value indicating whether the column displays a three-state checkbox.

public bool IsThreeState { get; set; }

Remarks

When true, the checkboxes in this column can be in three states: checked (true), unchecked (false), or indeterminate (null). When false, only checked and unchecked states are supported.