Skip to content
ConsoleMonster

API Reference

Class

TableColumn

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Modifiers sealed

A table column definition: header, width rules, overflow, priority (which columns hide first when space is short), a presenter for raw values, tone rules and how the column is summarised in subtotals and totals. The same column definitions drive record cards and record views, so a dataset is described once.

Inheritance

  • Object
  • TableColumn

Usage

Explore 72 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 37

Constructors

TableColumn 2 overloads
public TableColumn(String header) #

Creates a column.

Parameters

header System.String requiredposition: 0
The header (markup).
public TableColumn(RichText header) #

Creates a column with a multicolour header.

Parameters

header ConsoleMonster.Text.RichText requiredposition: 0
The header.

Properties

public String Header { get; set; } #

The header (markup).

public String? Key { get; set; } #

An identifier for the column (a property name), or null to use the header.

public HorizontalAlignment? Alignment { get; set; } #

Alignment; null = automatic (right for numeric columns, left otherwise). The header follows it.

public Boolean Wrap { get; set; } #

Whether values may wrap onto several lines when space is short (default true). Setting it maps to TableColumn.Overflow: true is ColumnOverflow.Wrap, false is ColumnOverflow.Never (identifiers keep their width while other columns give way).

public ColumnOverflow Overflow { get; set; } #

What happens to values wider than the column: wrap (default), truncate at the end, truncate in the middle, or never shorten.

public Int32 MaxLines { get; set; } #

The most lines a wrapped value may use (0 = unlimited); the last line ends with an ellipsis when cut.

public Int32 Priority { get; set; } #

The column's importance when the table is too wide: columns with the lowest priority hide first (ties hide from the right). The default is 0. Key columns never hide.

public Boolean IsKey { get; set; } #

Whether this is a key column: it never hides, and it titles the record cards.

public Boolean Flexible { get; set; } #

Whether this column takes spare width when the table expands (the main text column).

public Int32? MinWidth { get; set; } #

A minimum width, or null.

public Int32? MaxWidth { get; set; } #

A maximum width, or null.

public Int32? Width { get; set; } #

A fixed width, or null.

public ICellPresenter? Presenter { get; set; } #

How raw cell values are shown, or null for automatic (by value type). Markup cells are shown as written.

public IList<ToneRule> ToneRules { get; } #

Conditional tone rules for raw values; the first matching rule wins.

public ColumnAggregate Aggregate { get; set; } #

How the column is summarised in group subtotals and the totals row.

public String Id { get; } #

The identifier: TableColumn.Key, or the header without markup.

Extension Methods

public static TableColumn AddToneRule(TableColumn tableColumn, ToneRule item) #
Returns: TableColumn

Adds an item to TableColumn.ToneRules: Conditional tone rules for raw values; the first matching rule wins.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
item ConsoleMonster.Presenters.ToneRule requiredposition: 1
The item.

Returns

The same instance.

AddToneRules 2 overloads
public static TableColumn AddToneRules(TableColumn tableColumn, params ToneRule[] items) #
Returns: TableColumn

Adds items to TableColumn.ToneRules: Conditional tone rules for raw values; the first matching rule wins.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
items ConsoleMonster.Presenters.ToneRule[] requiredposition: 1
The items, in order.

Returns

The same instance.

public static TableColumn AddToneRules(TableColumn tableColumn, IEnumerable<ToneRule> items) #
Returns: TableColumn

Adds items to TableColumn.ToneRules: Conditional tone rules for raw values; the first matching rule wins.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Presenters.ToneRule> requiredposition: 1
The items, in order.

Returns

The same instance.

public static TableColumn WithAggregate(TableColumn tableColumn, ColumnAggregate value) #
Returns: TableColumn

Sets TableColumn.Aggregate: How the column is summarised in group subtotals and the totals row.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value ConsoleMonster.Widgets.ColumnAggregate requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithAlignment(TableColumn tableColumn, HorizontalAlignment? value) #
Returns: TableColumn

Sets TableColumn.Alignment: Alignment; null = automatic (right for numeric columns, left otherwise). The header follows it.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value ConsoleMonster.Layout.HorizontalAlignment? requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithFlexible(TableColumn tableColumn, Boolean value = true) #
Returns: TableColumn

Sets TableColumn.Flexible: Whether this column takes spare width when the table expands (the main text column).

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TableColumn WithHeader(TableColumn tableColumn, String value) #
Returns: TableColumn

Sets TableColumn.Header: The header (markup).

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.String requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithIsKey(TableColumn tableColumn, Boolean value = true) #
Returns: TableColumn

Sets TableColumn.IsKey: Whether this is a key column: it never hides, and it titles the record cards.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TableColumn WithKey(TableColumn tableColumn, String? value) #
Returns: TableColumn

Sets TableColumn.Key: An identifier for the column (a property name), or null to use the header.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithMaxLines(TableColumn tableColumn, Int32 value) #
Returns: TableColumn

Sets TableColumn.MaxLines: The most lines a wrapped value may use (0 = unlimited); the last line ends with an ellipsis when cut.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithMaxWidth(TableColumn tableColumn, Int32? value) #
Returns: TableColumn

Sets TableColumn.MaxWidth: A maximum width, or null.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.Int32? requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithMinWidth(TableColumn tableColumn, Int32? value) #
Returns: TableColumn

Sets TableColumn.MinWidth: A minimum width, or null.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.Int32? requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithOverflow(TableColumn tableColumn, ColumnOverflow value) #
Returns: TableColumn

Sets TableColumn.Overflow: What happens to values wider than the column: wrap (default), truncate at the end, truncate in the middle, or never shorten.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value ConsoleMonster.Widgets.ColumnOverflow requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithPresenter(TableColumn tableColumn, ICellPresenter? value) #
Returns: TableColumn

Sets TableColumn.Presenter: How raw cell values are shown, or null for automatic (by value type). Markup cells are shown as written.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value ConsoleMonster.Presenters.ICellPresenter? requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithPriority(TableColumn tableColumn, Int32 value) #
Returns: TableColumn

Sets TableColumn.Priority: The column's importance when the table is too wide: columns with the lowest priority hide first (ties hide from the right). The default is 0. Key columns never hide.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithWidth(TableColumn tableColumn, Int32? value) #
Returns: TableColumn

Sets TableColumn.Width: A fixed width, or null.

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.Int32? requiredposition: 1
The value.

Returns

The same instance.

public static TableColumn WithWrap(TableColumn tableColumn, Boolean value = true) #
Returns: TableColumn

Sets TableColumn.Wrap: Whether values may wrap onto several lines when space is short (default true). Setting it maps to TableColumn.Overflow: true is ColumnOverflow.Wrap, false is ColumnOverflow.Never (identifiers keep their width while other columns give way).

Parameters

tableColumn ConsoleMonster.Widgets.TableColumn requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.