Class NoxGridColumn
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
Properties
Alignment
Horizontal alignment of cell text.
public HorizontalAlignment Alignment { get; set; }
Property Value
AllowFilter
Shows a filter button on this column when the grid AllowFiltering is True. Default: True.
public bool AllowFilter { get; set; }
Property Value
AllowedValues
List of allowed values (empty means no check; case-insensitive).
public NoxValueList AllowedValues { get; }
Property Value
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
BackColor
Background color of cells in this column (empty for the grid setting).
public Color BackColor { get; set; }
Property Value
DataPropertyName
Name of the data source field bound to this column. Default: empty.
[TypeConverter(typeof(NoxDataPropertyNameConverter))]
public string DataPropertyName { get; set; }
Property Value
DefaultAlignment
Alignment of a new column of this kind.
protected virtual HorizontalAlignment DefaultAlignment { get; }
Property Value
DefaultFormat
Format of a new column of this kind.
protected virtual string DefaultFormat { get; }
Property Value
DefaultSortMode
Sort mode of a new column of this kind.
protected virtual NoxGridColumnSortMode DefaultSortMode { get; }
Property Value
DefaultValueType
Value type of a new column of this kind (Nothing: text).
protected virtual Type DefaultValueType { get; }
Property Value
DefaultWidth
Width of a new column of this kind.
protected virtual int DefaultWidth { get; }
Property Value
DisplayIndex
Gets the display index on screen (frozen columns first; -1 for hidden columns).
[Browsable(false)]
public int DisplayIndex { get; }
Property Value
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
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
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
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
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
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
FooterFormat
Format of the footer value (empty: the column Format; Count uses #,##0)
public string FooterFormat { get; set; }
Property Value
FooterFunction
What the footer row shows for this column (grid FooterVisible)
public NoxFooterFunction FooterFunction { get; set; }
Property Value
FooterText
Footer text when FooterFunction is Text (e.g. "Total")
public string FooterText { get; set; }
Property Value
ForeColor
Text color of cells in this column (empty for the grid setting).
public Color ForeColor { get; set; }
Property Value
Format
Display format of values (e.g. yyyy-MM-dd, #,##0.00).
public string Format { get; set; }
Property Value
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
Grid
Gets the grid this column belongs to.
[Browsable(false)]
public NoxGrid Grid { get; }
Property Value
HeaderAlignment
Header text alignment. Auto: follows the column Alignment. Default: Auto.
public NoxHeaderAlignment HeaderAlignment { get; set; }
Property Value
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
HeaderText
Text shown in the header. Default: empty.
public string HeaderText { get; set; }
Property Value
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
Index
Gets the index within Columns (-1 if none).
[Browsable(false)]
public int Index { get; }
Property Value
IsFiltered
Gets whether a filter is applied to this column.
[Browsable(false)]
public bool IsFiltered { get; }
Property Value
MaxLength
Maximum number of characters (0 means no check). Default: 0.
public int MaxLength { get; set; }
Property Value
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
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
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
MinimumWidth
Minimum width the user can resize the column to. Default: 20.
public int MinimumWidth { get; set; }
Property Value
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
NullText
Text shown when the value is empty. Default: empty.
public string NullText { get; set; }
Property Value
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
ReadOnly
Prevents the user from changing cells in this column. Default: False.
public bool ReadOnly { get; set; }
Property Value
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
Required
A value is required (cannot be left empty or cleared). Default: False.
public bool Required { get; set; }
Property Value
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
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
SortOrder
Header sort indicator (runtime state)
[Browsable(false)]
public NoxSortOrder SortOrder { get; set; }
Property Value
Tag
Arbitrary user data
[Browsable(false)]
public object Tag { get; set; }
Property Value
ToolTipText
Tooltip shown when the mouse is over the header. Default: empty.
public string ToolTipText { get; set; }
Property Value
ValidationMessage
Message shown when validation fails (empty for the default message of the rule).
public string ValidationMessage { get; set; }
Property Value
ValidationPattern
Regular expression pattern (e.g. ^\d{3}-\d{4}$). Empty means no check. Default: empty.
public string ValidationPattern { get; set; }
Property Value
ValueType
Type that edited text is converted to (empty for the data source or existing value type).
public Type ValueType { get; set; }
Property Value
VerticalAlignment
Vertical alignment of cell text (when rows are tall). Default: Middle.
public NoxVerticalAlignment VerticalAlignment { get; set; }
Property Value
Visible
Whether the column is visible. Default: True.
public bool Visible { get; set; }
Property Value
Width
Column width (px at 96 DPI, scaled with the display).
public int Width { get; set; }
Property Value
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
Methods
Changed(bool)
Redraws the grid after a column setting changes (layout True also recalculates column positions).
protected void Changed(bool layout)
Parameters
layoutbool
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposingbool
FormatEditValue(object)
Text to put in the edit box (default: display text; "" for empty values)
public virtual string FormatEditValue(object value)
Parameters
valueobject
Returns
FormatValue(object)
Converts a value to display text.
public virtual string FormatValue(object value)
Parameters
valueobject
Returns
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
Returns
ToString()
public override string ToString()