TableWidget<TRow>
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
A widget for displaying tabular data with columns, rows, and optional header/footer.
public record TableWidget<TRow> : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<TableWidget<TRow>>Inheritance
Object → Hex1bWidget → TableWidget<TRow>
Implements
Properties
Data
The data source for the table rows. When null, loading state is shown. When empty, empty state is shown.
Returns: IReadOnlyList<<TRow>>
public IReadOnlyList<TRow>? Data { get; init; }DataSource
Async data source for virtualized tables. When set, Data is ignored.
Returns: ITableDataSource<<TRow>>
public ITableDataSource<TRow>? DataSource { get; init; }FocusedKey
The key of the currently focused row (keyboard navigation cursor).
Returns: Object
public object? FocusedKey { get; init; }RenderMode
The render mode for the table (Compact or Full).
Returns: TableRenderMode
public TableRenderMode RenderMode { get; init; }ShowSelectionColumn
Whether to show a selection column with checkboxes.
Returns: Boolean
public bool ShowSelectionColumn { get; init; }Methods
Compact()
Sets the table to Compact render mode (no separators between rows). This is the default.
Returns: TableWidget`1
The table widget with Compact render mode.
public TableWidget<TRow> Compact()Empty(Func<RootContext, Hex1bWidget>)
Configures the empty state widget shown when data is empty.
Parameters:
builder(Func<RootContext, Hex1bWidget>): A function that builds the empty state widget.
Returns: TableWidget`1
The table widget with empty state configured.
public TableWidget<TRow> Empty(Func<RootContext, Hex1bWidget> builder)Focus(object?)
Configures the focused row by key.
Parameters:
focusedKey(Object): The key of the row that has keyboard focus, or null for none.
Returns: TableWidget`1
The table widget with focus configured.
public TableWidget<TRow> Focus(object? focusedKey)Footer(Func<TableFooterContext, IReadOnlyList<TableCell>>)
Configures the footer cells for the table.
Parameters:
builder(Func<TableFooterContext, TableCell>>): A function that returns the footer cells.
Returns: TableWidget`1
The table widget with footer configured.
public TableWidget<TRow> Footer(Func<TableFooterContext, IReadOnlyList<TableCell>> builder)Full()
Sets the table to Full render mode (horizontal separators between each row).
Returns: TableWidget`1
The table widget with Full render mode.
public TableWidget<TRow> Full()Header(Func<TableHeaderContext, IReadOnlyList<TableCell>>)
Configures the header cells for the table.
Parameters:
builder(Func<TableHeaderContext, TableCell>>): A function that returns the header cells.
Returns: TableWidget`1
The table widget with header configured.
public TableWidget<TRow> Header(Func<TableHeaderContext, IReadOnlyList<TableCell>> builder)OnDeselectAll(Action)
Sets the callback for "deselect all" action triggered from the header checkbox.
Parameters:
onDeselectAll(Action): Callback invoked when deselect all is triggered.
Returns: TableWidget`1
The table widget with deselect all handler configured.
public TableWidget<TRow> OnDeselectAll(Action onDeselectAll)OnFocusChanged(Action<object?>)
Sets the handler for focus changes.
Parameters:
handler(Action<Object>): The handler to call when focus changes.
Returns: TableWidget`1
The table widget with focus handler configured.
public TableWidget<TRow> OnFocusChanged(Action<object?> handler)OnFocusChanged(Func<object?, Task>)
Sets the async handler for focus changes.
Parameters:
handler(Func<Object, Task>): The async handler to call when focus changes.
Returns: TableWidget`1
The table widget with focus handler configured.
public TableWidget<TRow> OnFocusChanged(Func<object?, Task> handler)OnRowActivated(Action<object, TRow>)
Sets the handler for row activation (Enter key or double-click).
Parameters:
handler(Action<Object, <TRow>>): The handler to call when a row is activated.
Returns: TableWidget`1
The table widget with activation handler configured.
public TableWidget<TRow> OnRowActivated(Action<object, TRow> handler)OnRowActivated(Func<object, TRow, Task>)
Sets the async handler for row activation.
Parameters:
handler(Func<Object, <TRow>, Task>): The async handler to call when a row is activated.
Returns: TableWidget`1
The table widget with activation handler configured.
public TableWidget<TRow> OnRowActivated(Func<object, TRow, Task> handler)OnSelectAll(Action)
Sets the callback for "select all" action triggered from the header checkbox.
Parameters:
onSelectAll(Action): Callback invoked when select all is triggered.
Returns: TableWidget`1
The table widget with select all handler configured.
public TableWidget<TRow> OnSelectAll(Action onSelectAll)Row(Func<TableRowContext, TRow, TableRowState, IReadOnlyList<TableCell>>)
Configures the row cell builder for the table.
Parameters:
builder(Func<TableRowContext, <TRow>, TableRowState, TableCell>>): A function that builds cells for each row. Receives row context, row data, and row state.
Returns: TableWidget`1
The table widget with row builder configured.
public TableWidget<TRow> Row(Func<TableRowContext, TRow, TableRowState, IReadOnlyList<TableCell>> builder)RowKey(Func<TRow, object>)
Configures the row key selector for stable row identification across data changes.
Parameters:
keySelector(Func<<TRow>, Object>): A function that returns a unique key for each row.
Returns: TableWidget`1
The table widget with row key selector configured.
public TableWidget<TRow> RowKey(Func<TRow, object> keySelector)SelectionColumn()
Enables a selection column with checkboxes for multi-select.
Returns: TableWidget`1
The table widget with selection column enabled.
public TableWidget<TRow> SelectionColumn()SelectionColumn(Func<TRow, bool>, Action<TRow, bool>)
Enables a selection column with checkboxes for multi-select, with view model binding.
Parameters:
isSelected(Func<<TRow>, Boolean>): Selector to read selection state from the row.onChanged(Action<<TRow>, Boolean>): Callback invoked when selection state changes.
Returns: TableWidget`1
The table widget with selection column enabled.
public TableWidget<TRow> SelectionColumn(Func<TRow, bool> isSelected, Action<TRow, bool> onChanged)Fields
ClickRow
Rebindable action: Click on a row.
Returns: ActionId
public static readonly ActionId ClickRowExtendDown
Rebindable action: Extend selection down.
Returns: ActionId
public static readonly ActionId ExtendDownExtendToFirst
Rebindable action: Extend selection to first row.
Returns: ActionId
public static readonly ActionId ExtendToFirstExtendToLast
Rebindable action: Extend selection to last row.
Returns: ActionId
public static readonly ActionId ExtendToLastExtendUp
Rebindable action: Extend selection up.
Returns: ActionId
public static readonly ActionId ExtendUpMoveDown
Rebindable action: Move focus to next row.
Returns: ActionId
public static readonly ActionId MoveDownMoveToFirst
Rebindable action: Move focus to first row.
Returns: ActionId
public static readonly ActionId MoveToFirstMoveToLast
Rebindable action: Move focus to last row.
Returns: ActionId
public static readonly ActionId MoveToLastMoveUp
Rebindable action: Move focus to previous row.
Returns: ActionId
public static readonly ActionId MoveUpPageDown
Rebindable action: Scroll page down.
Returns: ActionId
public static readonly ActionId PageDownPageUp
Rebindable action: Scroll page up.
Returns: ActionId
public static readonly ActionId PageUpScrollDown
Rebindable action: Scroll down via mouse wheel.
Returns: ActionId
public static readonly ActionId ScrollDownScrollUp
Rebindable action: Scroll up via mouse wheel.
Returns: ActionId
public static readonly ActionId ScrollUpSelectAll
Rebindable action: Select all rows.
Returns: ActionId
public static readonly ActionId SelectAllToggleSelection
Rebindable action: Toggle row selection.
Returns: ActionId
public static readonly ActionId ToggleSelection