RowHeaderColumn<TModel> Class
Definition
A column that displays visual row numbers (0, 1, 2...).
public class RowHeaderColumn<TModel>
Remarks
The Avalonia.Controls.Models.TreeDataGrid.RowHeaderColumn<T> class provides a column type that displays visual row numbers. The numbers always represent the visual position of each row, remaining sequential regardless of sorting or whether the data source is flat or hierarchical.
This column type is designed to be explicitly added by users to their columns collection:
var source = new FlatTreeDataGridSource<Person>(people);
source.Columns.Add(new RowHeaderColumn<Person>());
source.Columns.Add(new TextColumn<Person, string>("Name", x => x.Name));
// Freeze the row header column if desired
treeDataGrid.FrozenColumnCount = 1;
Row header columns are read-only, do not support sorting, and are not user-resizable.
Constructors
| Name | Description |
|---|---|
| RowHeaderColumn<TModel> (2 overloads) | Initializes a new instance of the Avalonia.Controls.Models.TreeDataGrid.RowHeaderColumn<T> class with default settings. |
RowHeaderColumn<TModel> overloads
RowHeaderColumn<TModel> Constructor
Initializes a new instance of the Avalonia.Controls.Models.TreeDataGrid.RowHeaderColumn<T> class with default settings.
public RowHeaderColumn<TModel>()
Remarks
Creates a row header column with no header text and a default width of 50 pixels.
RowHeaderColumn<TModel> Constructor
public RowHeaderColumn<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
| Name | Description |
|---|---|
| CreateCell | No summary available. |
| GetComparison | Gets the comparison function for sorting by this column. |
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
GetComparison Method
Gets the comparison function for sorting by this column.
public Comparison<TModel> GetComparison(System.ComponentModel.ListSortDirection direction)
Parameters
direction System.ComponentModel.ListSortDirection
The sort direction.
Returns
Comparison<TModel>
Always returns null as row header columns do not support sorting.