Skip to content

TableWidget<TRow> ​

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A widget for displaying tabular data with columns, rows, and optional header/footer.

csharp
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>>

csharp
public IReadOnlyList<TRow>? Data { get; init; }

DataSource ​

Async data source for virtualized tables. When set, Data is ignored.

Returns: ITableDataSource<<TRow>>

csharp
public ITableDataSource<TRow>? DataSource { get; init; }

FocusedKey ​

The key of the currently focused row (keyboard navigation cursor).

Returns: Object

csharp
public object? FocusedKey { get; init; }

RenderMode ​

The render mode for the table (Compact or Full).

Returns: TableRenderMode

csharp
public TableRenderMode RenderMode { get; init; }

ShowSelectionColumn ​

Whether to show a selection column with checkboxes.

Returns: Boolean

csharp
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.

csharp
public TableWidget<TRow> Compact()

Empty(Func<RootContext, Hex1bWidget>) ​

Configures the empty state widget shown when data is empty.

Parameters:

Returns: TableWidget`1

The table widget with empty state configured.

csharp
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.

csharp
public TableWidget<TRow> Focus(object? focusedKey)

Configures the footer cells for the table.

Parameters:

Returns: TableWidget`1

The table widget with footer configured.

csharp
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.

csharp
public TableWidget<TRow> Full()

Header(Func<TableHeaderContext, IReadOnlyList<TableCell>>) ​

Configures the header cells for the table.

Parameters:

Returns: TableWidget`1

The table widget with header configured.

csharp
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.

csharp
public TableWidget<TRow> OnDeselectAll(Action onDeselectAll)

OnFocusChanged(Action<object?>) ​

Sets the handler for focus changes.

Parameters:

Returns: TableWidget`1

The table widget with focus handler configured.

csharp
public TableWidget<TRow> OnFocusChanged(Action<object?> handler)

OnFocusChanged(Func<object?, Task>) ​

Sets the async handler for focus changes.

Parameters:

Returns: TableWidget`1

The table widget with focus handler configured.

csharp
public TableWidget<TRow> OnFocusChanged(Func<object?, Task> handler)

OnRowActivated(Action<object, TRow>) ​

Sets the handler for row activation (Enter key or double-click).

Parameters:

Returns: TableWidget`1

The table widget with activation handler configured.

csharp
public TableWidget<TRow> OnRowActivated(Action<object, TRow> handler)

OnRowActivated(Func<object, TRow, Task>) ​

Sets the async handler for row activation.

Parameters:

Returns: TableWidget`1

The table widget with activation handler configured.

csharp
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.

csharp
public TableWidget<TRow> OnSelectAll(Action onSelectAll)

Row(Func<TableRowContext, TRow, TableRowState, IReadOnlyList<TableCell>>) ​

Configures the row cell builder for the table.

Parameters:

Returns: TableWidget`1

The table widget with row builder configured.

csharp
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:

Returns: TableWidget`1

The table widget with row key selector configured.

csharp
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.

csharp
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:

Returns: TableWidget`1

The table widget with selection column enabled.

csharp
public TableWidget<TRow> SelectionColumn(Func<TRow, bool> isSelected, Action<TRow, bool> onChanged)

Fields ​

ClickRow ​

Rebindable action: Click on a row.

Returns: ActionId

csharp
public static readonly ActionId ClickRow

ExtendDown ​

Rebindable action: Extend selection down.

Returns: ActionId

csharp
public static readonly ActionId ExtendDown

ExtendToFirst ​

Rebindable action: Extend selection to first row.

Returns: ActionId

csharp
public static readonly ActionId ExtendToFirst

ExtendToLast ​

Rebindable action: Extend selection to last row.

Returns: ActionId

csharp
public static readonly ActionId ExtendToLast

ExtendUp ​

Rebindable action: Extend selection up.

Returns: ActionId

csharp
public static readonly ActionId ExtendUp

MoveDown ​

Rebindable action: Move focus to next row.

Returns: ActionId

csharp
public static readonly ActionId MoveDown

MoveToFirst ​

Rebindable action: Move focus to first row.

Returns: ActionId

csharp
public static readonly ActionId MoveToFirst

MoveToLast ​

Rebindable action: Move focus to last row.

Returns: ActionId

csharp
public static readonly ActionId MoveToLast

MoveUp ​

Rebindable action: Move focus to previous row.

Returns: ActionId

csharp
public static readonly ActionId MoveUp

PageDown ​

Rebindable action: Scroll page down.

Returns: ActionId

csharp
public static readonly ActionId PageDown

PageUp ​

Rebindable action: Scroll page up.

Returns: ActionId

csharp
public static readonly ActionId PageUp

ScrollDown ​

Rebindable action: Scroll down via mouse wheel.

Returns: ActionId

csharp
public static readonly ActionId ScrollDown

ScrollUp ​

Rebindable action: Scroll up via mouse wheel.

Returns: ActionId

csharp
public static readonly ActionId ScrollUp

SelectAll ​

Rebindable action: Select all rows.

Returns: ActionId

csharp
public static readonly ActionId SelectAll

ToggleSelection ​

Rebindable action: Toggle row selection.

Returns: ActionId

csharp
public static readonly ActionId ToggleSelection

Released under the MIT License.