Table of Contents

Class NoxGridColumn

Namespace
Nox.Grid.WinForms
Assembly
Nox.Grid.WinForms.dll

Text column of NoxGrid (the base of all columns). Because it is a Component, the designer creates a field for each column (e.g. colCode), and it can be selected, edited and undone in the property grid.

public class NoxGridColumn : Component, IComponent, IDisposable
Inheritance
NoxGridColumn
Implements
Derived
Inherited Members

Constructors

NoxGridColumn()

Creates a text column.

public NoxGridColumn()

NoxGridColumn(string, string)

Creates a text column with a name and header text.

public NoxGridColumn(string name, string headerText)

Parameters

name string
headerText string

Properties

Alignment

Horizontal alignment of cell text.

public HorizontalAlignment Alignment { get; set; }

Property Value

HorizontalAlignment

AllowFilter

Shows a filter button on this column when the grid AllowFiltering is True. Default: True.

public bool AllowFilter { get; set; }

Property Value

bool

AllowedValues

List of allowed values (empty means no check; case-insensitive).

public NoxValueList AllowedValues { get; }

Property Value

NoxValueList

AutoSizeMode

DisplayedCells: fits the width to the cells shown on screen (and the header), again whenever the grid scrolls or values change. Default: None.

public NoxColumnAutoSizeMode AutoSizeMode { get; set; }

Property Value

NoxColumnAutoSizeMode

BackColor

Background color of cells in this column (empty for the grid setting).

public Color BackColor { get; set; }

Property Value

Color

DataPropertyName

Name of the data source field bound to this column. Default: empty.

[TypeConverter(typeof(NoxDataPropertyNameConverter))]
public string DataPropertyName { get; set; }

Property Value

string

DefaultAlignment

Alignment of a new column of this kind.

protected virtual HorizontalAlignment DefaultAlignment { get; }

Property Value

HorizontalAlignment

DefaultFormat

Format of a new column of this kind.

protected virtual string DefaultFormat { get; }

Property Value

string

DefaultSortMode

Sort mode of a new column of this kind.

protected virtual NoxGridColumnSortMode DefaultSortMode { get; }

Property Value

NoxGridColumnSortMode

DefaultValueType

Value type of a new column of this kind (Nothing: text).

protected virtual Type DefaultValueType { get; }

Property Value

Type

DefaultWidth

Width of a new column of this kind.

protected virtual int DefaultWidth { get; }

Property Value

int

DisplayIndex

Gets the display index on screen (frozen columns first; -1 for hidden columns).

[Browsable(false)]
public int DisplayIndex { get; }

Property Value

int

EditTrigger

How the user opens the edit box in this column. Default: Inherit (follows the grid's EditMode). F2OrDoubleClick and DoubleClickOnly stop typing (or a barcode scanner) from opening the edit box; Never stops the user entirely. BeginEdit from code always works. To stop every user change (paste, replace, Delete key too), use ReadOnly.

public NoxGridEditTrigger EditTrigger { get; set; }

Property Value

NoxGridEditTrigger

EditableWhenGridReadOnly

Lets this column be edited even when the grid ReadOnly is True (e.g. a selection check column on a lookup screen). Not editable if the column ReadOnly is True. Default: False.

public bool EditableWhenGridReadOnly { get; set; }

Property Value

bool

Exportable

Whether the column goes to Excel and CSV: Auto (when visible and Printable), Always (also when hidden), Never.

public NoxGridExportable Exportable { get; set; }

Property Value

NoxGridExportable

FillWeight

When 1 or more, the column takes a share of the remaining grid width in this proportion so no empty space is left. Width becomes the minimum. 0: no fill. Default: 0.

public int FillWeight { get; set; }

Property Value

int

FirstSortOrder

Sort direction of the first header click. Use Descending for columns read largest first, such as counts or amounts. Default: Ascending.

public NoxSortOrder FirstSortOrder { get; set; }

Property Value

NoxSortOrder

Font

Font of this column's cells (e.g. a fixed-width font for code columns). Empty uses the grid font. Default: Nothing.

public Font Font { get; set; }

Property Value

Font

FooterFormat

Format of the footer value (empty: the column Format; Count uses #,##0)

public string FooterFormat { get; set; }

Property Value

string

FooterFunction

What the footer row shows for this column (grid FooterVisible)

public NoxFooterFunction FooterFunction { get; set; }

Property Value

NoxFooterFunction

FooterText

Footer text when FooterFunction is Text (e.g. "Total")

public string FooterText { get; set; }

Property Value

string

ForeColor

Text color of cells in this column (empty for the grid setting).

public Color ForeColor { get; set; }

Property Value

Color

Format

Display format of values (e.g. yyyy-MM-dd, #,##0.00).

public string Format { get; set; }

Property Value

string

Frozen

Keeps the column at the left while scrolling horizontally. Frozen columns are always shown first. Default: False.

public bool Frozen { get; set; }

Property Value

bool

Grid

Gets the grid this column belongs to.

[Browsable(false)]
public NoxGrid Grid { get; }

Property Value

NoxGrid

HeaderAlignment

Header text alignment. Auto: follows the column Alignment. Default: Auto.

public NoxHeaderAlignment HeaderAlignment { get; set; }

Property Value

NoxHeaderAlignment

HeaderGroup

Group header above the column header (multi-row headers). Adjacent columns with the same group are drawn under one merged cell. Separate levels with | from the top, e.g. "2026 H1|January". Empty: no group (the header uses the full header height).

public string HeaderGroup { get; set; }

Property Value

string

HeaderText

Text shown in the header. Default: empty.

public string HeaderText { get; set; }

Property Value

string

ImeMode

Input method state while editing this column. Use Disable for barcode or code columns (scanner input is never composed into Hangul). Default: Inherit.

public NoxImeMode ImeMode { get; set; }

Property Value

NoxImeMode

Index

Gets the index within Columns (-1 if none).

[Browsable(false)]
public int Index { get; }

Property Value

int

IsFiltered

Gets whether a filter is applied to this column.

[Browsable(false)]
public bool IsFiltered { get; }

Property Value

bool

MaxLength

Maximum number of characters (0 means no check). Default: 0.

public int MaxLength { get; set; }

Property Value

int

MaximumValue

Maximum value (number, date or text, compared using the column type). Empty means no check. Default: empty.

public string MaximumValue { get; set; }

Property Value

string

MergeMode

Shows consecutive equal values as one merged cell. Restricted: only within the merged ranges of the column to the left. Default: None.

public NoxMergeMode MergeMode { get; set; }

Property Value

NoxMergeMode

MinimumValue

Minimum value (number, date or text, compared using the column type). Empty means no check. Default: empty.

public string MinimumValue { get; set; }

Property Value

string

MinimumWidth

Minimum width the user can resize the column to. Default: 20.

public int MinimumWidth { get; set; }

Property Value

int

Name

Gets or sets the column name. In the designer it matches the component name ((Name)).

[Browsable(false)]
public string Name { get; set; }

Property Value

string

NullText

Text shown when the value is empty. Default: empty.

public string NullText { get; set; }

Property Value

string

Printable

False leaves this column out of printing and CSV/Excel export (it is still shown on screen). Default: True.

public bool Printable { get; set; }

Property Value

bool

ReadOnly

Prevents the user from changing cells in this column. Default: False.

public bool ReadOnly { get; set; }

Property Value

bool

ReadOnlyMode

How read-only cells of this column react to F2 or double-click. Default: Locked (nothing opens). Selectable: a read-only edit box opens so the text can be selected and copied; the value never changes and typing does not open it. Applies to column, row, cell and grid ReadOnly. Works with EditTrigger (for example DoubleClickOnly).

public NoxGridReadOnlyMode ReadOnlyMode { get; set; }

Property Value

NoxGridReadOnlyMode

Required

A value is required (cannot be left empty or cleared). Default: False.

public bool Required { get; set; }

Property Value

bool

SortCompareMode

How the grid compares text when it sorts this column (unbound grid). Natural compares runs of digits as numbers ("2" before "10", "1:80" before "1:1280"). Default: Text.

public NoxSortCompareMode SortCompareMode { get; set; }

Property Value

NoxSortCompareMode

SortMode

How the column is sorted when its header is clicked. Default: Automatic; NotSortable for check box, combo box, button, image and progress columns (as in DataGridView). Sort called from code works whatever this is.

public NoxGridColumnSortMode SortMode { get; set; }

Property Value

NoxGridColumnSortMode

SortOrder

Header sort indicator (runtime state)

[Browsable(false)]
public NoxSortOrder SortOrder { get; set; }

Property Value

NoxSortOrder

Tag

Arbitrary user data

[Browsable(false)]
public object Tag { get; set; }

Property Value

object

ToolTipText

Tooltip shown when the mouse is over the header. Default: empty.

public string ToolTipText { get; set; }

Property Value

string

ValidationMessage

Message shown when validation fails (empty for the default message of the rule).

public string ValidationMessage { get; set; }

Property Value

string

ValidationPattern

Regular expression pattern (e.g. ^\d{3}-\d{4}$). Empty means no check. Default: empty.

public string ValidationPattern { get; set; }

Property Value

string

ValueType

Type that edited text is converted to (empty for the data source or existing value type).

public Type ValueType { get; set; }

Property Value

Type

VerticalAlignment

Vertical alignment of cell text (when rows are tall). Default: Middle.

public NoxVerticalAlignment VerticalAlignment { get; set; }

Property Value

NoxVerticalAlignment

Visible

Whether the column is visible. Default: True.

public bool Visible { get; set; }

Property Value

bool

Width

Column width (px at 96 DPI, scaled with the display).

public int Width { get; set; }

Property Value

int

WrapText

Wraps text that is wider than the cell (set row heights with AutoResizeRows or manually). Default: False.

public bool WrapText { get; set; }

Property Value

bool

Methods

Changed(bool)

Redraws the grid after a column setting changes (layout True also recalculates column positions).

protected void Changed(bool layout)

Parameters

layout bool

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool

FormatEditValue(object)

Text to put in the edit box (default: display text; "" for empty values)

public virtual string FormatEditValue(object value)

Parameters

value object

Returns

string

FormatValue(object)

Converts a value to display text.

public virtual string FormatValue(object value)

Parameters

value object

Returns

string

ParseValue(string, Type)

Converts edited text to a value. targetType is determined in the order ValueType → data source type → existing value type. Throws FormatException if the text cannot be converted.

public virtual object ParseValue(string text, Type targetType)

Parameters

text string
targetType Type

Returns

object

ToString()

public override string ToString()

Returns

string