Specialized Table Columns
Elaris.UI provides specialized column types for common use cases: CheckboxColumn and ProgressColumn.
CheckboxColumn
Section titled “CheckboxColumn”CheckboxColumn displays a checkbox in each cell, bound to a boolean property.
var checkboxColumn = new CheckboxColumn("Done", 6) .BindTo<TaskItem>(t => t.IsComplete);table.AddColumn(checkboxColumn);The checkbox is automatically checked/unchecked based on the bound property value.
ProgressColumn
Section titled “ProgressColumn”ProgressColumn displays a progress bar in each cell, bound to a numeric value.
Properties
Section titled “Properties”ShowPercentage: Whether to show percentage textFilledColor: Color of filled portionUnfilledColor: Color of unfilled portion
var progressColumn = new ProgressColumn("Progress", 20){ ShowPercentage = true, FilledColor = Color.Green}.BindTo<TaskItem>(t => t.Progress);
table.AddColumn(progressColumn);Custom Column Types
Section titled “Custom Column Types”You can create custom column types by inheriting from TableColumn:
public class CustomColumn : TableColumn{ public CustomColumn(string name, int width) : base(name, width) { }
public override TableCell CreateCell(TableRow row, object? value) { return new CustomCell(this, row, value); }}Then create a custom cell type:
public class CustomCell : TableCell{ public CustomCell(TableColumn column, TableRow row, object? value) : base(column, row, value) { }
public override void Render(Screen screen, int x, int y, int width, bool isSelected, Color fg, Color bg) { // Custom rendering logic }}Related Widgets
Section titled “Related Widgets”- Table - Main table widget
- Table Columns - Base column types