Table of Contents

Class ColumnStyle

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Describes how to render a given column in a TableView including Alignment and textual representation of cells (e.g. date formats) See TableView Deep Dive for more information.

public class ColumnStyle
Inheritance
ColumnStyle
Inherited Members

Fields

AlignmentGetter

Defines a delegate for returning custom alignment per cell based on cell values. When specified this will override Alignment

ColorGetter

Defines a delegate for returning a custom color scheme per cell based on cell values. Return null for the default

RepresentationGetter

Defines a delegate for returning custom representations of cell values. If not set then ToString() is used. Return values from your delegate may be truncated e.g. based on MaxWidth

Properties

Alignment

Defines the default alignment for all values rendered in this column. For custom alignment based on cell contents use AlignmentGetter.

Format

Defines the format for values e.g. "yyyy-MM-dd" for dates

MaxWidth

Set the maximum width of the column in characters. This value will be ignored if more than the tables MaxCellWidth. Defaults to DefaultMaxCellWidth

MinAcceptableWidth

Enables flexible sizing of this column based on available screen space to render into.

MinWidth

Set the minimum width of the column in characters. Setting this will ensure that even when a column has short content/header it still fills a given width of the control.

This value will be ignored if more than the tables MaxCellWidth or the MaxWidth

For setting a flexible column width (down to a lower limit) use MinAcceptableWidth instead
Visible

Gets or Sets a value indicating whether the column should be visible to the user. This affects both whether it is rendered and whether it can be selected. Defaults to true.

Methods

GetAlignment(object)

Returns the alignment for the cell based on cellValue and AlignmentGetter/ Alignment

GetRepresentation(object)

Returns the full string to render (which may be truncated if too long) that the current style says best represents the given value