Table of Contents

Class NoxGrid

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

Nox custom-drawn grid. Only the visible rows and columns are drawn. Supports unbound (Cells), bound (DataSource = DataTable, BindingSource, IList) and virtual (INoxVirtualDataSource) modes.

[ToolboxBitmap(typeof(NoxGrid), "NoxGrid.bmp")]
[ComplexBindingProperties("DataSource", "DataMember")]
[Docking(DockingBehavior.Ask)]
public class NoxGrid : Control, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, ISupportInitialize
Inheritance
NoxGrid
Implements
Inherited Members

Constructors

NoxGrid()

Creates an empty grid.

public NoxGrid()

Properties

AccentColor

Accent color (current-cell border, selected headers, filter buttons, default progress bar color).

public Color AccentColor { get; set; }

Property Value

Color

AllowFiltering

Shows filter buttons in column headers to filter rows by value list or search. Default: False.

public bool AllowFiltering { get; set; }

Property Value

bool

AllowFind

Lets the user find text with Ctrl+F and F3 (find next). Default: True. Finding never changes data. Replacing (Ctrl+H) also needs AllowReplace, which is off by default.

public bool AllowFind { get; set; }

Property Value

bool

AllowPaste

Lets the user paste with Ctrl+V and Shift+Insert. Default: True. Read-only cells are skipped, combo LimitToList and validation rules are kept, and CellPasting can cancel or change each cell. Paste and PasteFromClipboard from code work regardless. See also UserDataChanges.

public bool AllowPaste { get; set; }

Property Value

bool

AllowReplace

Lets the user replace text (Ctrl+H and the Replace part of the find window). Default: False. Replace skips read-only and formula cells, keeps combo LimitToList and the column's validation rules, and can be undone in one step. ReplaceAll and Replace from code work regardless.

public bool AllowReplace { get; set; }

Property Value

bool

AllowUndo

Enables undo and redo with Ctrl+Z / Ctrl+Y. On by default.

public bool AllowUndo { get; set; }

Property Value

bool

AllowUserFormulas

Allows the user to type or paste formulas starting with = into cells.

public bool AllowUserFormulas { get; set; }

Property Value

bool

AllowUserToAddRows

Unbound: keeps a new-row slot (header *) at the bottom. Entering a value makes it a real row and adds a new slot (UserAddedRow). Default: False.

public bool AllowUserToAddRows { get; set; }

Property Value

bool

AllowUserToHideColumns

Right-clicking a column header shows a checked list of columns to show or hide.

public bool AllowUserToHideColumns { get; set; }

Property Value

bool

AllowUserToOrderColumns

Allows reordering columns by dragging headers. Default: False.

public bool AllowUserToOrderColumns { get; set; }

Property Value

bool

AllowUserToResizeColumns

Allows resizing columns by dragging header borders. Default: True.

public bool AllowUserToResizeColumns { get; set; }

Property Value

bool

AlternatingRowBackColor

Background color of even rows (second, fourth, …).

public Color AlternatingRowBackColor { get; set; }

Property Value

Color

AutoGenerateColumns

When a data source is bound at run time and there are no columns, creates a column for each field. Default: True.

public bool AutoGenerateColumns { get; set; }

Property Value

bool

AutoSizeRowsMode

Fits row heights to their content automatically (after binding, value changes and column width changes). Use with WrapText columns. DisplayedCells only measures the rows on screen. Default: None.

public NoxGridAutoSizeRowsMode AutoSizeRowsMode { get; set; }

Property Value

NoxGridAutoSizeRowsMode

CanRedo

Whether there is an undone action to redo.

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

Property Value

bool

CanUndo

Whether there is a step to undo.

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

Property Value

bool

CellBackColor

Cell background color. The empty area without rows is painted with BackColor.

public Color CellBackColor { get; set; }

Property Value

Color

CellPadding

Space between the cell border and its text, left and right (px at 96 DPI). Default 6.

public int CellPadding { get; set; }

Property Value

int

Cells

Cell access: Cells[row, column].Value

[Browsable(false)]
public NoxGridCellCollection Cells { get; }

Property Value

NoxGridCellCollection

ColorScheme

Applies a color scheme. Changes header, cell, alternating row, grid line, selection, highlight and read-only colors at once (the modern family also sets a bold header and horizontal lines only). Each property can be changed individually afterwards (the designer saves each property).

public NoxGridColorScheme ColorScheme { get; set; }

Property Value

NoxGridColorScheme

ColumnCount

Gets or sets the number of columns. Increasing it appends text columns (headers A, B, C …); decreasing it removes columns from the end.

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

Property Value

int

Columns

Gets the collection of columns.

public NoxGridColumnCollection Columns { get; }

Property Value

NoxGridColumnCollection

ConditionalFormats

Conditional formatting rules (rules higher in the list take precedence). Editable in the designer property grid.

public NoxConditionalFormatCollection ConditionalFormats { get; }

Property Value

NoxConditionalFormatCollection

CopyIncludesHeaders

Includes the header row when copying (Ctrl+C). Default: False.

public bool CopyIncludesHeaders { get; set; }

Property Value

bool

CreateParams

protected override CreateParams CreateParams { get; }

Property Value

CreateParams

CurrentCell

Gets the current cell (null if none).

[Browsable(false)]
public NoxGridCell CurrentCell { get; }

Property Value

NoxGridCell

CurrentCellBorderColor

Border color of the current cell. Also drawn on the current cell in FullRowSelect (empty: FullRowSelect shows only the dotted row outline).

public Color CurrentCellBorderColor { get; set; }

Property Value

Color

CurrentColumnIndex

Gets the Columns index of the current column (-1 if none).

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

Property Value

int

CurrentRowIndex

Gets the current row (data row index; -1 if none).

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

Property Value

int

DataMember

Name of the list within the data source (such as a table name in a DataSet). Default: empty.

public string DataMember { get; set; }

Property Value

string

DataSource

Data source: DataTable, DataView, DataSet (+DataMember), BindingSource, IList, IListSource, or an INoxVirtualDataSource for virtual mode.

public object DataSource { get; set; }

Property Value

object

DefaultSize

protected override Size DefaultSize { get; }

Property Value

Size

DeleteKeyAction

What the Delete key does: ClearValues (clear the selected cells), DeleteRows (delete the selected rows; UserDeletingRow can cancel), None. Default: ClearValues.

public NoxDeleteKeyAction DeleteKeyAction { get; set; }

Property Value

NoxDeleteKeyAction

DisplayedRowCount

Number of rows fully visible on one screen (excluding frozen rows)

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

Property Value

int

EditMode

How cell editing starts. Default: NoxGridEditMode.EditOnKeystrokeOrF2.

public NoxGridEditMode EditMode { get; set; }

Property Value

NoxGridEditMode

EditingControl

Gets the editing control (TextBox or ComboBox; null if none).

[Browsable(false)]
public Control EditingControl { get; }

Property Value

Control

EmptyCellsLast

When the grid sorts (unbound grid), empty cells (Nothing, DBNull, "") go after the other values in both directions, as in Excel. Applies to the grid's own comparison; a SortCompare handler with Handled = True decides for itself. Default: False (empty cells first in ascending order).

public bool EmptyCellsLast { get; set; }

Property Value

bool

FirstDisplayedRowIndex

Gets or sets the topmost visible row in the scrolling area (data row index).

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

Property Value

int

FooterVisible

Shows the footer (summary) row fixed at the bottom. Set FooterFunction on the columns.

public bool FooterVisible { get; set; }

Property Value

bool

FrozenRowCount

Number of rows kept at the top while scrolling vertically. Default: 0.

public int FrozenRowCount { get; set; }

Property Value

int

GridLineColor

Grid line color.

public Color GridLineColor { get; set; }

Property Value

Color

HeaderAutoHeight

With HeaderWrapText, grows the header to fit the longest header. False keeps HeaderHeight and wraps within it. Default: True.

public bool HeaderAutoHeight { get; set; }

Property Value

bool

HeaderBackColor

Header background color.

public Color HeaderBackColor { get; set; }

Property Value

Color

HeaderBold

Draws column header text in bold. Default: False.

public bool HeaderBold { get; set; }

Property Value

bool

HeaderFont

Font of the column headers. Empty uses the grid font (bold with HeaderBold). Default: Nothing.

public Font HeaderFont { get; set; }

Property Value

Font

HeaderForeColor

Header text color.

public Color HeaderForeColor { get; set; }

Property Value

Color

HeaderHeight

Header height (px at 96 DPI). Default: 28.

public int HeaderHeight { get; set; }

Property Value

int

HeaderShrinkMinimum

Smallest size HeaderTextFit = ShrinkText may use, as a share of the header font (0.5 to 1). Text that still does not fit is cut with an ellipsis. Default: 0.7.

public float HeaderShrinkMinimum { get; set; }

Property Value

float

HeaderTextFit

What a one-line column header does when its text is wider than the column. Default: Ellipsis (cut with ...). ShrinkText draws it smaller (down to HeaderShrinkMinimum, 70% by default) to fit on one line, which suits short Korean headers that wrap badly one character at a time. Ignored when HeaderWrapText is True.

public NoxHeaderTextFit HeaderTextFit { get; set; }

Property Value

NoxHeaderTextFit

HeaderWrapText

Wraps the header text of narrow columns onto several lines. The header grows automatically (at least HeaderHeight). Default: False.

public bool HeaderWrapText { get; set; }

Property Value

bool

HorizontalScrollingOffset

Gets or sets the horizontal scroll offset (px, area excluding frozen columns).

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

Property Value

int

IsCurrentCellInEditMode

Gets whether the current cell is being edited.

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

Property Value

bool

IsUpdating

Whether a BeginUpdate block is open.

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

Property Value

bool

this[int, int]

Cell value: C# grid[row, column], VB NoxGrid1(row, column)

[Browsable(false)]
public object this[int rowIndex, int columnIndex] { get; set; }

Parameters

rowIndex int
columnIndex int

Property Value

object

this[int, string]

Cell value (by column name)

[Browsable(false)]
public object this[int rowIndex, string columnName] { get; set; }

Parameters

rowIndex int
columnName string

Property Value

object

KeepGeneratedColumnSettings

When a new data source with the same fields is bound, keeps the header text, width, visibility, order, format, alignment, frozen, read-only and fill weight of the automatically generated columns.

public bool KeepGeneratedColumnSettings { get; set; }

Property Value

bool

KeepScrollPositionOnInsert

When scrolled down, rows inserted above the screen keep the rows being looked at in place (no Scroll event). At the top, new rows are shown. Default: False.

public bool KeepScrollPositionOnInsert { get; set; }

Property Value

bool

MultiSelect

Allows selecting multiple cells with Ctrl, Shift and dragging. Default: True.

public bool MultiSelect { get; set; }

Property Value

bool

PasteAddsRows

Pasting more lines than there are rows below adds rows (unbound mode; the added rows are part of the same undo step and DefaultValuesNeeded fills them). Default: False, the extra lines are dropped and Pasted reports DroppedRowCount.

public bool PasteAddsRows { get; set; }

Property Value

bool

PrintSettings

Gets the print settings.

[Browsable(false)]
public NoxPrintSettings PrintSettings { get; set; }

Property Value

NoxPrintSettings

ReadOnly

Prevents the user from changing cell values. Default: False.

public bool ReadOnly { get; set; }

Property Value

bool

ReadOnlyBackColor

Background color of read-only cells (ReadOnly column, row or cell, and label columns). Leave empty to use the normal cell color.

public Color ReadOnlyBackColor { get; set; }

Property Value

Color

ReadOnlyForeColor

Text color of read-only cells. Empty draws them like other cells.

public Color ReadOnlyForeColor { get; set; }

Property Value

Color

RedoActionName

Name of the action Redo would repeat (empty if none).

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

Property Value

string

RowCount

Gets or sets the number of rows. Can be changed only in unbound mode.

public int RowCount { get; set; }

Property Value

int

RowGroups

Row groups (in order of start row)

[Browsable(false)]
public IReadOnlyList<NoxRowGroup> RowGroups { get; }

Property Value

IReadOnlyList<NoxRowGroup>

RowHeadersVisible

Shows row headers (row numbers). Default: False.

public bool RowHeadersVisible { get; set; }

Property Value

bool

RowHeadersWidth

Row header width (px at 96 DPI). Default: 44.

public int RowHeadersWidth { get; set; }

Property Value

int

RowHeight

Row height (px at 96 DPI). Default: 24.

public int RowHeight { get; set; }

Property Value

int

RowKeyMember

Bound: field of the data item used as the row Key (Rows.IndexOfKey). Empty: keys are set in code.

public string RowKeyMember { get; set; }

Property Value

string

Rows

Row collection: Add, Insert, RemoveAt, Clear; per-row height, visibility and colors

[Browsable(false)]
public NoxGridRowCollection Rows { get; }

Property Value

NoxGridRowCollection

SelectFirstRowOnBind

After binding or filling, makes the first row current (like DataGridView). Off by default.

public bool SelectFirstRowOnBind { get; set; }

Property Value

bool

SelectedCellCount

Number of selected cells

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

Property Value

int

SelectionBackColor

Background color of selected cells.

public Color SelectionBackColor { get; set; }

Property Value

Color

SelectionForeColor

Text color of selected cells.

public Color SelectionForeColor { get; set; }

Property Value

Color

SelectionMode

Whether selection works by cell or by entire row. Default: CellSelect. RowHeaderSelect works like CellSelect, but only rows selected with the row header (or SelectRow, Ctrl+A, the top-left corner) count as selected rows, as in DataGridView.

public NoxGridSelectionMode SelectionMode { get; set; }

Property Value

NoxGridSelectionMode

SelectionOverridesCellColors

Selected cells use SelectionForeColor instead of cell, row, column or conditional text colors (readability on a dark selection color). A cell SelectionForeColor still wins. Default: False.

public bool SelectionOverridesCellColors { get; set; }

Property Value

bool

ShowCellToolTips

Shows truncated cell text and header descriptions as tooltips. Default: True.

public bool ShowCellToolTips { get; set; }

Property Value

bool

ShowGridLines

Draws grid lines. Default: True.

public bool ShowGridLines { get; set; }

Property Value

bool

ShowHeaders

Shows column headers. Default: True.

public bool ShowHeaders { get; set; }

Property Value

bool

ShowValidationErrors

Marks cells that break column validation rules with a red corner and shows the message on hover. Default: True.

public bool ShowValidationErrors { get; set; }

Property Value

bool

SortColumns

Current sort columns (in priority order). Each column's direction is its SortOrder.

[Browsable(false)]
public IReadOnlyList<NoxGridColumn> SortColumns { get; }

Property Value

IReadOnlyList<NoxGridColumn>

SortCycle

What clicking a header cycles through. AscendingDescendingNone removes the sort on the third click (bound: data order, unbound: the order before sorting). Default: AscendingDescending.

public NoxGridSortCycle SortCycle { get; set; }

Property Value

NoxGridSortCycle

Spans

Explicit merge list

[Browsable(false)]
public IReadOnlyList<NoxGridSpan> Spans { get; }

Property Value

IReadOnlyList<NoxGridSpan>

UndoActionName

Name of the next action to undo (e.g. "Edit", "Paste")

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

Property Value

string

UndoLimit

Number of undo steps to keep. Default: 100.

public int UndoLimit { get; set; }

Property Value

int

UserDataChanges

One switch for every user feature that changes data besides the edit box. Default: All (each feature follows its own setting). EditOnly turns off paste, undo and redo keys, replace, Delete key clearing and user formulas at once, and also any such feature added in later versions. Code (Paste, Undo, ReplaceAll, SetFormula ...) still works.

public NoxGridUserDataChanges UserDataChanges { get; set; }

Property Value

NoxGridUserDataChanges

VerticalGridLines

Draws vertical grid lines. False draws horizontal lines only (list style). Default: True.

public bool VerticalGridLines { get; set; }

Property Value

bool

VisibleRowCount

Number of rows shown on screen (excluding hidden and filtered rows)

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

Property Value

int

Methods

AddRow()

Unbound mode: appends an empty row and returns the new row index.

public int AddRow()

Returns

int

AddSpan(int, int, int, int)

Merges cells (overlapping existing merges are removed). The value is the top-left cell's.

public NoxGridSpan AddSpan(int rowIndex, int columnIndex, int rowCount, int columnCount)

Parameters

rowIndex int
columnIndex int
rowCount int
columnCount int

Returns

NoxGridSpan

AddSubtotals(NoxGridColumn, NoxSubtotalFunction, params NoxGridColumn[])

Inserts a subtotal row (SUBTOTAL formula) below each run of rows with the same value and groups them. Adds a grand total row at the bottom. Rows must be sorted by groupColumn (unbound mode). Can be undone in a single step. Returns the number of groups created.

public int AddSubtotals(NoxGridColumn groupColumn, NoxSubtotalFunction function, params NoxGridColumn[] valueColumns)

Parameters

groupColumn NoxGridColumn
function NoxSubtotalFunction
valueColumns NoxGridColumn[]

Returns

int

AddSubtotals(string, NoxSubtotalFunction, params string[])

Inserts subtotal rows by column names (see the overload with columns). Returns the number of groups created.

public int AddSubtotals(string groupColumnName, NoxSubtotalFunction function, params string[] valueColumnNames)

Parameters

groupColumnName string
function NoxSubtotalFunction
valueColumnNames string[]

Returns

int

ApplyColorScheme(NoxGridColorScheme)

Applies a color scheme.

public void ApplyColorScheme(NoxGridColorScheme scheme)

Parameters

scheme NoxGridColorScheme

ApplyColorSettings(string)

Applies colors from GetColorSettings: the scheme first, then each saved color. Unknown entries are ignored.

public void ApplyColorSettings(string settings)

Parameters

settings string

ApplyLayout(string, bool)

Applies a layout from GetLayout (or the web edition). Columns are matched by name: missing columns are ignored, columns not in the layout keep their settings and go after the listed ones. Pass applySort False to keep the current sort.

public void ApplyLayout(string layout, bool applySort = true)

Parameters

layout string
applySort bool

AutoResizeColumn(int)

Adjusts the column width to fit the header and the text of the visible rows.

public void AutoResizeColumn(int columnIndex)

Parameters

columnIndex int

AutoResizeColumns()

Adjusts the widths of all visible columns.

public void AutoResizeColumns()

AutoResizeRow(int)

Fits the row height to its content (never smaller than RowHeight).

public void AutoResizeRow(int rowIndex)

Parameters

rowIndex int

AutoResizeRows()

Fits all row heights to their content.

public void AutoResizeRows()

BeginEdit(bool)

Starts editing the current cell.

public bool BeginEdit(bool selectAll)

Parameters

selectAll bool

Returns

bool

BeginUndoAction(string)

Starts recording work done in code as a single unit (paired with EndUndoAction; can be nested). Example: when a button removes rows or changes several cells.

public void BeginUndoAction(string name)

Parameters

name string

BeginUpdate()

Suspends drawing and scroll bar updates (before bulk changes). Paired with EndUpdate.

public void BeginUpdate()

CanSort(NoxGridColumn)

Whether the grid can sort by the column: unbound and virtual grids always can; a bound grid can when the data source sorts (IBindingList.SupportsSorting, such as DataTable/DataView or BindingSource over one) and the column is bound to one of its fields. A List(Of T) cannot be sorted.

public bool CanSort(NoxGridColumn column)

Parameters

column NoxGridColumn

Returns

bool

CancelEdit()

Cancels editing (the value is not changed).

public void CancelEdit()

ClearCurrentCell()

Removes the current cell (no current cell and no selection), like DataGridView CurrentCell = Nothing. The grid does not pick the first cell again when it gets focus; clicks and arrow keys set a current cell as usual. Returns False if the edit being made cannot be committed.

public bool ClearCurrentCell()

Returns

bool

ClearCurrentCellValue(bool)

Clears the value of the current cell (or of all selected cells when selectedCells = True). Read-only cells are skipped.

public void ClearCurrentCellValue(bool selectedCells = false)

Parameters

selectedCells bool

ClearFilter(NoxGridColumn)

Removes the filter of one column.

public void ClearFilter(NoxGridColumn column)

Parameters

column NoxGridColumn

ClearFilters()

Removes every filter.

public void ClearFilters()

ClearRange(int, int, int, int)

Clears the range values.

public void ClearRange(int rowIndex, int columnIndex, int rowCount, int columnCount)

Parameters

rowIndex int
columnIndex int
rowCount int
columnCount int

ClearRowGroups()

Removes every row group (outline). Rows stay; collapsed rows are shown again.

public void ClearRowGroups()

ClearSelection()

Clears the selection (the current cell stays).

public void ClearSelection()

ClearSort()

Removes the sort. Unbound: rows go back to the order before the grid sorted them (rows added while sorted go to the end, rows inserted at the top go to the front). Bound: the data source order. Columns the app sorted itself (Programmatic) only lose the indicator. ClearSort(False) keeps the current order.

public void ClearSort()

ClearSort(bool)

Removes the sort. restoreOriginalOrder True (what ClearSort() does): unbound rows go back to the order before the grid sorted them. False: only the sort indicator is removed and the rows stay as they are. Bound grids always use the data source order.

public void ClearSort(bool restoreOriginalOrder)

Parameters

restoreOriginalOrder bool

ClearSpans()

Removes every merged area added with AddSpan.

public void ClearSpans()

ClearUnboundValues()

Bound grid: clears the values (and formulas) of every unbound column, such as a check column the app added next to the data fields. Unbound values follow their data item when the list is sorted, filtered or bound again with the same items (DataGridView clears them when DataSource is set again); call this before or after binding to start empty. Not recorded for undo (the undo history is cleared). Does nothing in an unbound grid.

public void ClearUnboundValues()

ClearUndo()

Clears the undo history (e.g. after the data is first loaded).

public void ClearUndo()

ClearValues()

Clears all values (unbound). The row count is unchanged.

public void ClearValues()

CollapseAll()

Collapses every row group.

public void CollapseAll()

CollapseGroup(NoxRowGroup)

Collapses a row group (hides its detail rows).

public void CollapseGroup(NoxRowGroup group)

Parameters

group NoxRowGroup

CopyToClipboard()

Copies the selected cells to the clipboard (Ctrl+C).

public void CopyToClipboard()

CreateAccessibilityInstance()

protected override AccessibleObject CreateAccessibilityInstance()

Returns

AccessibleObject

CreatePrintDocument()

Document for printing (when working with PrintDocument directly).

public PrintDocument CreatePrintDocument()

Returns

PrintDocument

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool

EndEdit()

Commits the edited value. Returns False if validation or conversion fails (editing continues).

public bool EndEdit()

Returns

bool

EndUndoAction()

Ends the unit started with BeginUndoAction.

public void EndUndoAction()

EndUpdate()

Ends a BeginUpdate block and draws once.

public void EndUpdate()

EnsureVisible(int, int)

Scrolls so the cell is visible (ignored for hidden or filtered rows).

public void EnsureVisible(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Evaluate(string)

Evaluates a formula without putting it in a cell and returns the value. Example: NoxGrid1.Evaluate("SUM(B1:B10)"). Throws NoxFormulaException if the syntax is invalid.

public object Evaluate(string formula)

Parameters

formula string

Returns

object

ExpandAll()

Expands every row group.

public void ExpandAll()

ExpandGroup(NoxRowGroup)

Expands a row group (shows its detail rows).

public void ExpandGroup(NoxRowGroup group)

Parameters

group NoxRowGroup

ExportToCsv(Stream, NoxExportOptions)

Writes the grid as CSV (UTF-8) to a stream.

public void ExportToCsv(Stream stream, NoxExportOptions options)

Parameters

stream Stream
options NoxExportOptions

ExportToCsv(string)

Saves the grid as a CSV file (UTF-8) with default options.

public void ExportToCsv(string path)

Parameters

path string

ExportToCsv(string, NoxExportOptions)

Saves the grid as a CSV file (UTF-8).

public void ExportToCsv(string path, NoxExportOptions options)

Parameters

path string
options NoxExportOptions

ExportToExcel(Stream, NoxExportOptions)

Writes an Excel workbook (.xlsx). Built with Office Open XML, without external libraries.

public void ExportToExcel(Stream stream, NoxExportOptions options)

Parameters

stream Stream
options NoxExportOptions

ExportToExcel(string)

Saves the grid as an Excel file (.xlsx) with default options (shown rows, headers, formats and formulas).

public void ExportToExcel(string path)

Parameters

path string

ExportToExcel(string, NoxExportOptions)

Saves the grid as an Excel file (.xlsx).

public void ExportToExcel(string path, NoxExportOptions options)

Parameters

path string
options NoxExportOptions

FindNext(string)

Finds the next cell that contains the text, after the current cell (if found, moves the current cell there and returns True).

public bool FindNext(string text)

Parameters

text string

Returns

bool

FindNext(string, NoxFindOptions)

Finds the next cell (if found, moves the current cell there and returns True).

public bool FindNext(string text, NoxFindOptions options)

Parameters

text string
options NoxFindOptions

Returns

bool

GetCellBounds(int, int)

Screen bounds of the cell (the merged area for merged cells; Rectangle.Empty if not visible)

public Rectangle GetCellBounds(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

Rectangle

GetCellContentBounds(int, int)

Bounds of the cell's content in grid coordinates (what CellContentClick reacts to): the check box (or its picture), the button, the text, or the picture and text. Empty when the cell has no content (empty text, a progress cell) or is not shown.

public Rectangle GetCellContentBounds(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

Rectangle

GetClipboardText(bool)

Returns the selected cells as tab-delimited text (cells outside the selection are empty).

public string GetClipboardText(bool includeHeaders)

Parameters

includeHeaders bool

Returns

string

GetColorSettings()

The colors as text (JSON): the color scheme name and every color property, plus HeaderBold and VerticalGridLines. Store it (e.g. user settings) and give it to ApplyColorSettings on any grid.

public string GetColorSettings()

Returns

string

GetCsvText(NoxExportOptions)

CSV text (without BOM)

public string GetCsvText(NoxExportOptions options)

Parameters

options NoxExportOptions

Returns

string

GetFooterValue(NoxGridColumn)

Footer value of the column (calculated by FooterFunction; FooterValueNeeded can change it)

public object GetFooterValue(NoxGridColumn column)

Parameters

column NoxGridColumn

Returns

object

GetFooterValue(string)

Footer value of the column with this name

public object GetFooterValue(string columnName)

Parameters

columnName string

Returns

object

GetFormula(int, int)

Returns the cell formula ("=…"), or Nothing if the cell has no formula.

public string GetFormula(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

string

GetFormula(int, string)

Formula of a cell by column name ("=..."), or Nothing if the cell has none.

public string GetFormula(int rowIndex, string columnName)

Parameters

rowIndex int
columnName string

Returns

string

GetLayout()

Column layout as text (JSON): width, order, visibility and frozen state of each column by name, and the sort. Store it (settings, database) and give it back to ApplyLayout. The web edition uses the same format.

public string GetLayout()

Returns

string

GetSelectedRows()

Rows spanned by the selection (data row indexes, ascending). With SelectionMode = RowHeaderSelect: only rows selected as rows (row header, SelectRow, Ctrl+A, the top-left corner), not rows whose cells were selected by clicking or dragging.

public int[] GetSelectedRows()

Returns

int[]

GetSpanAt(int, int)

Explicit merge the cell belongs to (null if none)

public NoxGridSpan GetSpanAt(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

NoxGridSpan

GetText(int, int)

Display text

public string GetText(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

string

GetText(int, string)

Text shown in a cell, by column name.

public string GetText(int rowIndex, string columnName)

Parameters

rowIndex int
columnName string

Returns

string

GetValidationError(int, int)

Returns a message if the cell violates its validation rules, or Nothing if it is valid.

public string GetValidationError(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

string

GetValue(int, int)

Value of a cell.

public object GetValue(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

object

GetValue(int, string)

Value of a cell by column name.

public object GetValue(int rowIndex, string columnName)

Parameters

rowIndex int
columnName string

Returns

object

GetValues(int, int, int, int)

Returns the range values as a two-dimensional array.

public object[,] GetValues(int rowIndex, int columnIndex, int rowCount, int columnCount)

Parameters

rowIndex int
columnIndex int
rowCount int
columnCount int

Returns

object[,]

GroupRows(int, int)

Groups rows (groups can be nested or wrapped but not partially overlap; up to 7 levels).

public NoxRowGroup GroupRows(int startRow, int count)

Parameters

startRow int
count int

Returns

NoxRowGroup

HasFormula(int, int)

Whether the cell has a formula.

public bool HasFormula(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

bool

HitTest(int, int)

Hit test (merged cells report the top-left cell).

public NoxGridHitTestInfo HitTest(int x, int y)

Parameters

x int
y int

Returns

NoxGridHitTestInfo

ImportCsvText(string, NoxImportOptions)

Imports CSV text (from the clipboard or a string).

public void ImportCsvText(string text, NoxImportOptions options)

Parameters

text string
options NoxImportOptions

ImportFromCsv(Stream, NoxImportOptions)

Imports CSV (delimited text).

public void ImportFromCsv(Stream stream, NoxImportOptions options)

Parameters

stream Stream
options NoxImportOptions

ImportFromCsv(string)

Loads a CSV file into the grid with default options.

public void ImportFromCsv(string path)

Parameters

path string

ImportFromCsv(string, NoxImportOptions)

Loads a CSV file into the grid.

public void ImportFromCsv(string path, NoxImportOptions options)

Parameters

path string
options NoxImportOptions

ImportFromExcel(Stream, NoxImportOptions)

Imports one sheet of an Excel workbook (.xlsx). Excel 97-2003 .xls is not supported.

public void ImportFromExcel(Stream stream, NoxImportOptions options)

Parameters

stream Stream
options NoxImportOptions

ImportFromExcel(string)

Loads the first sheet of an Excel file (.xlsx) into the grid with default options.

public void ImportFromExcel(string path)

Parameters

path string

ImportFromExcel(string, NoxImportOptions)

Loads a sheet of an Excel file (.xlsx) into the grid.

public void ImportFromExcel(string path, NoxImportOptions options)

Parameters

path string
options NoxImportOptions

InsertRows(int, int)

Unbound mode: inserts an empty row at index.

public void InsertRows(int index, int count)

Parameters

index int
count int

InvalidateCell(int, int)

Redraws a cell.

public void InvalidateCell(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

InvalidateRow(int)

Redraws a row.

public void InvalidateRow(int rowIndex)

Parameters

rowIndex int

IsCellSelected(int, int)

Whether the cell is selected.

public bool IsCellSelected(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

Returns

bool

IsInputKey(Keys)

protected override bool IsInputKey(Keys keyData)

Parameters

keyData Keys

Returns

bool

IsRowSelected(int)

Whether any cell in the row is selected. With SelectionMode = RowHeaderSelect: whether the row is selected as a row (row header, SelectRow, Ctrl+A).

public bool IsRowSelected(int rowIndex)

Parameters

rowIndex int

Returns

bool

IsRowVisible(int)

Whether the row is shown on screen (considering hidden and filtered state)

public bool IsRowVisible(int rowIndex)

Parameters

rowIndex int

Returns

bool

IsSubtotalRow(int)

Whether the row is a subtotal row (added by AddSubtotals)

public bool IsSubtotalRow(int rowIndex)

Parameters

rowIndex int

Returns

bool

OnBindingContextChanged(EventArgs)

Raises the BindingContextChanged event.

protected override void OnBindingContextChanged(EventArgs e)

Parameters

e EventArgs

OnCellBeginEdit(NoxGridCellCancelEventArgs)

Raises the CellBeginEdit event.

protected virtual void OnCellBeginEdit(NoxGridCellCancelEventArgs e)

Parameters

e NoxGridCellCancelEventArgs

OnCellButtonClick(NoxGridCellEventArgs)

Raises the CellButtonClick event.

protected virtual void OnCellButtonClick(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnCellClick(NoxGridCellEventArgs)

Raises the CellClick event.

protected virtual void OnCellClick(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnCellContentClick(NoxGridCellEventArgs)

Raises the CellContentClick event.

protected virtual void OnCellContentClick(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnCellContentDoubleClick(NoxGridCellEventArgs)

Raises the CellContentDoubleClick event.

protected virtual void OnCellContentDoubleClick(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnCellDoubleClick(NoxGridCellEventArgs)

Raises the CellDoubleClick event.

protected virtual void OnCellDoubleClick(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnCellEndEdit(NoxGridCellEventArgs)

Raises the CellEndEdit event.

protected virtual void OnCellEndEdit(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnCellFormatting(NoxGridCellFormattingEventArgs)

Raises the CellFormatting event.

protected virtual void OnCellFormatting(NoxGridCellFormattingEventArgs e)

Parameters

e NoxGridCellFormattingEventArgs

OnCellMouseClick(NoxGridCellMouseEventArgs)

Raises the CellMouseClick event.

protected virtual void OnCellMouseClick(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnCellMouseDoubleClick(NoxGridCellMouseEventArgs)

Raises the CellMouseDoubleClick event.

protected virtual void OnCellMouseDoubleClick(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnCellMouseDown(NoxGridCellMouseEventArgs)

Raises the CellMouseDown event.

protected virtual void OnCellMouseDown(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnCellMouseEnter(NoxGridCellEventArgs)

Raises the CellMouseEnter event.

protected virtual void OnCellMouseEnter(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnCellMouseLeave(NoxGridCellEventArgs)

Raises the CellMouseLeave event.

protected virtual void OnCellMouseLeave(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnCellMouseMove(NoxGridCellMouseEventArgs)

Raises the CellMouseMove event.

protected virtual void OnCellMouseMove(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnCellMouseUp(NoxGridCellMouseEventArgs)

Raises the CellMouseUp event.

protected virtual void OnCellMouseUp(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnCellPainting(NoxGridCellPaintingEventArgs)

Raises the CellPainting event.

protected virtual void OnCellPainting(NoxGridCellPaintingEventArgs e)

Parameters

e NoxGridCellPaintingEventArgs

OnCellToolTipTextNeeded(NoxGridCellToolTipTextNeededEventArgs)

Raises the CellToolTipTextNeeded event.

protected virtual void OnCellToolTipTextNeeded(NoxGridCellToolTipTextNeededEventArgs e)

Parameters

e NoxGridCellToolTipTextNeededEventArgs

OnCellValidating(NoxGridCellValidatingEventArgs)

Raises the CellValidating event.

protected virtual void OnCellValidating(NoxGridCellValidatingEventArgs e)

Parameters

e NoxGridCellValidatingEventArgs

OnCellValueChanged(NoxGridCellEventArgs)

Raises the CellValueChanged event.

protected virtual void OnCellValueChanged(NoxGridCellEventArgs e)

Parameters

e NoxGridCellEventArgs

OnColumnDisplayIndexChanged(NoxGridColumnEventArgs)

Raises the ColumnDisplayIndexChanged event.

protected virtual void OnColumnDisplayIndexChanged(NoxGridColumnEventArgs e)

Parameters

e NoxGridColumnEventArgs

OnColumnHeaderMouseClick(NoxGridCellMouseEventArgs)

Raises the ColumnHeaderMouseClick event.

protected virtual void OnColumnHeaderMouseClick(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnColumnHeaderMouseDoubleClick(NoxGridCellMouseEventArgs)

Raises the ColumnHeaderMouseDoubleClick event.

protected virtual void OnColumnHeaderMouseDoubleClick(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnColumnHeaderPainting(NoxGridColumnHeaderPaintingEventArgs)

Raises the ColumnHeaderPainting event.

protected virtual void OnColumnHeaderPainting(NoxGridColumnHeaderPaintingEventArgs e)

Parameters

e NoxGridColumnHeaderPaintingEventArgs

OnColumnWidthChanged(NoxGridColumnEventArgs)

Raises the ColumnWidthChanged event.

protected virtual void OnColumnWidthChanged(NoxGridColumnEventArgs e)

Parameters

e NoxGridColumnEventArgs

OnCurrentCellChanged(EventArgs)

Raises the CurrentCellChanged event.

protected virtual void OnCurrentCellChanged(EventArgs e)

Parameters

e EventArgs

OnCurrentRowChanged(EventArgs)

Raises the CurrentRowChanged event.

protected virtual void OnCurrentRowChanged(EventArgs e)

Parameters

e EventArgs

OnDataBindingComplete(NoxGridBindingCompleteEventArgs)

Raises the DataBindingComplete event.

protected virtual void OnDataBindingComplete(NoxGridBindingCompleteEventArgs e)

Parameters

e NoxGridBindingCompleteEventArgs

OnDataError(NoxGridDataErrorEventArgs)

Raises the DataError event.

protected virtual void OnDataError(NoxGridDataErrorEventArgs e)

Parameters

e NoxGridDataErrorEventArgs

OnDataSourceChanged(EventArgs)

Raises the DataSourceChanged event.

protected virtual void OnDataSourceChanged(EventArgs e)

Parameters

e EventArgs

OnDpiChangedAfterParent(EventArgs)

Raises the DpiChangedAfterParent event.

protected override void OnDpiChangedAfterParent(EventArgs e)

Parameters

e EventArgs

OnEditingControlShowing(NoxGridEditingControlShowingEventArgs)

Raises the EditingControlShowing event.

protected virtual void OnEditingControlShowing(NoxGridEditingControlShowingEventArgs e)

Parameters

e NoxGridEditingControlShowingEventArgs

OnFilterChanged(EventArgs)

Raises the FilterChanged event.

protected virtual void OnFilterChanged(EventArgs e)

Parameters

e EventArgs

OnFontChanged(EventArgs)

Raises the FontChanged event.

protected override void OnFontChanged(EventArgs e)

Parameters

e EventArgs

OnFooterValueNeeded(NoxGridFooterValueEventArgs)

Raises the FooterValueNeeded event.

protected virtual void OnFooterValueNeeded(NoxGridFooterValueEventArgs e)

Parameters

e NoxGridFooterValueEventArgs

OnGotFocus(EventArgs)

Raises the GotFocus event.

protected override void OnGotFocus(EventArgs e)

Parameters

e EventArgs

OnHandleCreated(EventArgs)

Raises the HandleCreated event.

protected override void OnHandleCreated(EventArgs e)

Parameters

e EventArgs

OnKeyDown(KeyEventArgs)

Raises the KeyDown event.

protected override void OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

OnKeyPress(KeyPressEventArgs)

Raises the KeyPress event.

protected override void OnKeyPress(KeyPressEventArgs e)

Parameters

e KeyPressEventArgs

OnLostFocus(EventArgs)

Raises the LostFocus event.

protected override void OnLostFocus(EventArgs e)

Parameters

e EventArgs

OnMouseCaptureChanged(EventArgs)

Raises the MouseCaptureChanged event.

protected override void OnMouseCaptureChanged(EventArgs e)

Parameters

e EventArgs

OnMouseDoubleClick(MouseEventArgs)

Raises the MouseDoubleClick event.

protected override void OnMouseDoubleClick(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseDown(MouseEventArgs)

Raises the MouseDown event.

protected override void OnMouseDown(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseLeave(EventArgs)

Raises the MouseLeave event.

protected override void OnMouseLeave(EventArgs e)

Parameters

e EventArgs

OnMouseMove(MouseEventArgs)

Raises the MouseMove event.

protected override void OnMouseMove(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseUp(MouseEventArgs)

Raises the MouseUp event.

protected override void OnMouseUp(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseWheel(MouseEventArgs)

Raises the MouseWheel event.

protected override void OnMouseWheel(MouseEventArgs e)

Parameters

e MouseEventArgs

OnPaint(PaintEventArgs)

Raises the Paint event.

protected override void OnPaint(PaintEventArgs e)

Parameters

e PaintEventArgs

OnPaintBackground(PaintEventArgs)

Raises the PaintBackground event.

protected override void OnPaintBackground(PaintEventArgs e)

Parameters

e PaintEventArgs

OnResize(EventArgs)

Raises the Resize event.

protected override void OnResize(EventArgs e)

Parameters

e EventArgs

OnRowHeaderMouseClick(NoxGridCellMouseEventArgs)

Raises the RowHeaderMouseClick event.

protected virtual void OnRowHeaderMouseClick(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnRowHeaderMouseDoubleClick(NoxGridCellMouseEventArgs)

Raises the RowHeaderMouseDoubleClick event.

protected virtual void OnRowHeaderMouseDoubleClick(NoxGridCellMouseEventArgs e)

Parameters

e NoxGridCellMouseEventArgs

OnRowsAdded(NoxGridRowsEventArgs)

Raises the RowsAdded event.

protected virtual void OnRowsAdded(NoxGridRowsEventArgs e)

Parameters

e NoxGridRowsEventArgs

OnRowsRemoved(NoxGridRowsEventArgs)

Raises the RowsRemoved event.

protected virtual void OnRowsRemoved(NoxGridRowsEventArgs e)

Parameters

e NoxGridRowsEventArgs

OnScroll(NoxGridScrollEventArgs)

Raises the Scroll event.

protected virtual void OnScroll(NoxGridScrollEventArgs e)

Parameters

e NoxGridScrollEventArgs

OnSelectionChanged(EventArgs)

Raises the SelectionChanged event.

protected virtual void OnSelectionChanged(EventArgs e)

Parameters

e EventArgs

OnSortCompare(NoxGridSortCompareEventArgs)

Raises the SortCompare event.

protected virtual void OnSortCompare(NoxGridSortCompareEventArgs e)

Parameters

e NoxGridSortCompareEventArgs

OnSorted(EventArgs)

Raises the Sorted event.

protected virtual void OnSorted(EventArgs e)

Parameters

e EventArgs

OnSorting(NoxGridSortingEventArgs)

Raises the Sorting event.

protected virtual void OnSorting(NoxGridSortingEventArgs e)

Parameters

e NoxGridSortingEventArgs

OnUndoStateChanged(EventArgs)

Raises the UndoStateChanged event.

protected virtual void OnUndoStateChanged(EventArgs e)

Parameters

e EventArgs

OnUserAddedRow(NoxGridRowsEventArgs)

Raises the UserAddedRow event.

protected virtual void OnUserAddedRow(NoxGridRowsEventArgs e)

Parameters

e NoxGridRowsEventArgs

OnUserDeletedRow(NoxGridRowsEventArgs)

Raises the UserDeletedRow event.

protected virtual void OnUserDeletedRow(NoxGridRowsEventArgs e)

Parameters

e NoxGridRowsEventArgs

OnUserDeletingRow(NoxGridRowCancelEventArgs)

Raises the UserDeletingRow event.

protected virtual void OnUserDeletingRow(NoxGridRowCancelEventArgs e)

Parameters

e NoxGridRowCancelEventArgs

Paste(string)

Pastes tab-delimited text. Pasting a single value onto a multi-cell selection fills every selected cell. Read-only cells are skipped. Returns the number of cells updated.

public int Paste(string text)

Parameters

text string

Returns

int

PasteFromClipboard()

Pastes clipboard text starting at the current cell (Ctrl+V).

public int PasteFromClipboard()

Returns

int

Print()

Prints after showing the printer selection dialog.

public void Print()

Print(bool)

Prints (showDialog = True shows the printer selection dialog).

public void Print(bool showDialog)

Parameters

showDialog bool

PrintPreview()

Shows the print preview window.

public void PrintPreview()

ReapplyFilters()

Reapplies the filter conditions (to refilter after values change).

public void ReapplyFilters()

Recalculate()

Recalculates all formulas and redraws (to refresh functions such as TODAY and RAND, or external values).

public void Recalculate()

Redo()

Redoes the undone action.

public bool Redo()

Returns

bool

RefreshData()

Re-reads the data source and redraws (e.g. when a virtual source does not raise DataChanged).

public void RefreshData()

RemoveRows(int, int)

Unbound mode: removes count rows starting at index.

public void RemoveRows(int index, int count)

Parameters

index int
count int

RemoveSelectedRows()

Removes the rows spanned by the selection (bound: deletes them from the data source).

public int RemoveSelectedRows()

Returns

int

RemoveSpans(int, int, int, int)

Removes merges that overlap the range.

public void RemoveSpans(int rowIndex, int columnIndex, int rowCount, int columnCount)

Parameters

rowIndex int
columnIndex int
rowCount int
columnCount int

RemoveSubtotals()

Removes the subtotal and grand total rows added by AddSubtotals and ungroups.

public void RemoveSubtotals()

Replace(string, string, NoxFindOptions)

Replaces the current cell if it matches, then finds the next one. Returns True if a replacement was made.

public bool Replace(string find, string replacement, NoxFindOptions options)

Parameters

find string
replacement string
options NoxFindOptions

Returns

bool

ReplaceAll(string, string, NoxFindOptions)

Replaces all (excluding read-only and formula cells; undone in a single step). Returns the number of cells replaced.

public int ReplaceAll(string find, string replacement, NoxFindOptions options)

Parameters

find string
replacement string
options NoxFindOptions

Returns

int

SelectAll()

Selects every cell (MultiSelect only).

public void SelectAll()

SelectRange(int, int, int, int)

Selects a cell range (by data row and Columns index; hidden rows and columns are skipped).

public void SelectRange(int rowIndex1, int columnIndex1, int rowIndex2, int columnIndex2)

Parameters

rowIndex1 int
columnIndex1 int
rowIndex2 int
columnIndex2 int

SelectRow(int, bool)

Selects a row. add = True adds to the existing selection.

public void SelectRow(int rowIndex, bool add)

Parameters

rowIndex int
add bool

SetAllChecked(NoxGridCheckBoxColumn, bool)

Checks or unchecks every shown row of the column (filtered, hidden and collapsed rows are skipped; read-only cells too). Returns the number of changed rows. One undo step.

public int SetAllChecked(NoxGridCheckBoxColumn column, bool check)

Parameters

column NoxGridCheckBoxColumn
check bool

Returns

int

SetCurrentCell(int, int)

Sets the current cell (the selection moves to it as well). Ignored for hidden or filtered rows. Moving from code does not start editing, even with EditOnEnter (focus stays where it is).

public void SetCurrentCell(int rowIndex, int columnIndex)

Parameters

rowIndex int
columnIndex int

SetCurrentCell(int, int, bool)

Sets the current cell. beginEdit = True starts editing as well (EditOnEnter behaviour).

public void SetCurrentCell(int rowIndex, int columnIndex, bool beginEdit)

Parameters

rowIndex int
columnIndex int
beginEdit bool

SetFilter(NoxGridColumn, IEnumerable<string>)

Shows only rows whose display text is in the list (empty values are "").

public void SetFilter(NoxGridColumn column, IEnumerable<string> allowedTexts)

Parameters

column NoxGridColumn
allowedTexts IEnumerable<string>

SetFilter(NoxGridColumn, Predicate<object>)

Shows only rows for which the predicate returns True (by value).

public void SetFilter(NoxGridColumn column, Predicate<object> predicate)

Parameters

column NoxGridColumn
predicate Predicate<object>

SetFilterContains(NoxGridColumn, string)

Shows only rows whose display text contains text (case-insensitive).

public void SetFilterContains(NoxGridColumn column, string text)

Parameters

column NoxGridColumn
text string

SetFormula(int, int, string)

Sets a cell formula ("=SUM(A1:A3)" or "SUM(A1:A3)"). An empty string or Nothing removes the formula.

public void SetFormula(int rowIndex, int columnIndex, string formula)

Parameters

rowIndex int
columnIndex int
formula string

SetFormula(int, string, string)

Sets a cell formula by column name ("=SUM(A1:A3)"). An empty string or Nothing removes the formula.

public void SetFormula(int rowIndex, string columnName, string formula)

Parameters

rowIndex int
columnName string
formula string

SetText(int, int, string)

Converts the text to the column type and stores it (throws FormatException if it cannot be converted).

public void SetText(int rowIndex, int columnIndex, string text)

Parameters

rowIndex int
columnIndex int
text string

SetText(int, string, string)

Sets a cell from text by column name, converted with the column's type and format (as if typed).

public void SetText(int rowIndex, string columnName, string text)

Parameters

rowIndex int
columnName string
text string

SetValue(int, int, object)

Sets the value of a cell.

public void SetValue(int rowIndex, int columnIndex, object value)

Parameters

rowIndex int
columnIndex int
value object

SetValue(int, string, object)

Sets the value of a cell by column name.

public void SetValue(int rowIndex, string columnName, object value)

Parameters

rowIndex int
columnName string
value object

SetValues(int, int, object[,])

Puts the values of a two-dimensional array starting at (row, column).

public void SetValues(int rowIndex, int columnIndex, object[,] values)

Parameters

rowIndex int
columnIndex int
values object[,]

ShowColumnMenu(Point)

Shows the column show/hide menu at a point (grid coordinates).

public void ShowColumnMenu(Point location)

Parameters

location Point

ShowExportDialog()

Shows a save-file dialog and saves as CSV or Excel. Returns the saved path (null if canceled).

public string ShowExportDialog()

Returns

string

ShowFilterPopup(NoxGridColumn)

Opens the header filter popup (can also be called from code).

public void ShowFilterPopup(NoxGridColumn column)

Parameters

column NoxGridColumn

ShowFindDialog(bool)

Find dialog (replace = True also shows the replace box).

public void ShowFindDialog(bool replace)

Parameters

replace bool

ShowImportDialog()

Shows an open-file dialog and imports Excel or CSV. Returns the opened file path (Nothing if canceled).

public string ShowImportDialog()

Returns

string

ShowOutlineLevel(int)

Shows only up to the level (Excel's 1 2 3 buttons). 1 = collapse to the outermost groups.

public void ShowOutlineLevel(int level)

Parameters

level int

ShowPageSetup()

Page setup dialog (orientation, margins) → applied to PrintSettings.

public bool ShowPageSetup()

Returns

bool

Sort(NoxGridColumn, NoxSortOrder)

Sorts by a column. Unbound: the grid sorts the rows. Bound: the data source (IBindingList) sorts. Virtual: only the indicator changes (the data source sorts in the Sorting event). None clears the sort indicator.

public void Sort(NoxGridColumn column, NoxSortOrder order)

Parameters

column NoxGridColumn
order NoxSortOrder

Sort(NoxGridColumn[], NoxSortOrder[])

Sorts by multiple columns: when the first column is equal, compares the second column, and so on. VB: NoxGrid1.Sort({colDept, colName}, {NoxSortOrder.Ascending, NoxSortOrder.Descending}). In bound mode, sorting by two or more columns requires the data source to be an IBindingListView (such as DataView).

public void Sort(NoxGridColumn[] columns, NoxSortOrder[] orders)

Parameters

columns NoxGridColumn[]
orders NoxSortOrder[]

ToggleGroup(NoxRowGroup)

Collapses the group if expanded, expands it if collapsed.

public void ToggleGroup(NoxRowGroup group)

Parameters

group NoxRowGroup

Undo()

Undoes the last action.

public bool Undo()

Returns

bool

UngroupRows(int, int)

Ungroups the groups that lie entirely within the range.

public void UngroupRows(int startRow, int count)

Parameters

startRow int
count int

Validate()

Validates all cells and moves to the first invalid one. Returns the list of invalid cells.

public NoxGridValidationError[] Validate()

Returns

NoxGridValidationError[]

Validate(bool)

Validates all cells (e.g. before saving). Returns the list of invalid cells. selectFirst moves to the first one.

public NoxGridValidationError[] Validate(bool selectFirst)

Parameters

selectFirst bool

Returns

NoxGridValidationError[]

WndProc(ref Message)

protected override void WndProc(ref Message m)

Parameters

m Message

Events

CellBeginEdit

Occurs before cell editing starts. Set Cancel to prevent it.

public event EventHandler<NoxGridCellCancelEventArgs> CellBeginEdit

Event Type

EventHandler<NoxGridCellCancelEventArgs>

CellButtonClick

Occurs when a button in a button column is clicked.

public event EventHandler<NoxGridCellEventArgs> CellButtonClick

Event Type

EventHandler<NoxGridCellEventArgs>

CellClick

Occurs when a cell is clicked.

public event EventHandler<NoxGridCellEventArgs> CellClick

Event Type

EventHandler<NoxGridCellEventArgs>

CellComboItemsNeeded

Occurs before a combo cell's list opens. Fill e.Items with the list for this cell (starts with the cell's ComboItems or the column list).

public event EventHandler<NoxGridComboItemsEventArgs> CellComboItemsNeeded

Event Type

EventHandler<NoxGridComboItemsEventArgs>

CellContentClick

Occurs when the content of a cell is clicked, as in DataGridView: the check box of a check box column, the button of a button column, the text of a text cell, the picture or text of an image cell. Clicking the empty part of the cell does not raise it. Also raised by the Space key on a check box or button cell. The second press of a double-click raises CellContentDoubleClick instead.

public event EventHandler<NoxGridCellEventArgs> CellContentClick

Event Type

EventHandler<NoxGridCellEventArgs>

CellContentDoubleClick

Occurs when the content of a cell (see CellContentClick) is double-clicked: raised by the second press instead of CellContentClick.

public event EventHandler<NoxGridCellEventArgs> CellContentDoubleClick

Event Type

EventHandler<NoxGridCellEventArgs>

CellDoubleClick

Occurs when a cell is double-clicked.

public event EventHandler<NoxGridCellEventArgs> CellDoubleClick

Event Type

EventHandler<NoxGridCellEventArgs>

CellEndEdit

Occurs when cell editing ends (committed or cancelled).

public event EventHandler<NoxGridCellEventArgs> CellEndEdit

Event Type

EventHandler<NoxGridCellEventArgs>

CellFormatting

Occurs just before a cell is drawn. Text and colors can be changed (conditional formatting).

public event EventHandler<NoxGridCellFormattingEventArgs> CellFormatting

Event Type

EventHandler<NoxGridCellFormattingEventArgs>

CellMouseClick

Mouse pressed and released on the same cell (any button). Column header: RowIndex = -1, row header: ColumnIndex = -1.

public event EventHandler<NoxGridCellMouseEventArgs> CellMouseClick

Event Type

EventHandler<NoxGridCellMouseEventArgs>

CellMouseDoubleClick

Cell or header double-clicked (with button and position).

public event EventHandler<NoxGridCellMouseEventArgs> CellMouseDoubleClick

Event Type

EventHandler<NoxGridCellMouseEventArgs>

CellMouseDown

Mouse button pressed on a cell or header (button, modifiers, position in the cell). e.Handled = True skips the grid's own handling (check toggle, selection).

public event EventHandler<NoxGridCellMouseEventArgs> CellMouseDown

Event Type

EventHandler<NoxGridCellMouseEventArgs>

CellMouseEnter

Mouse entered a cell (headers included).

public event EventHandler<NoxGridCellEventArgs> CellMouseEnter

Event Type

EventHandler<NoxGridCellEventArgs>

CellMouseLeave

Mouse left a cell (headers included).

public event EventHandler<NoxGridCellEventArgs> CellMouseLeave

Event Type

EventHandler<NoxGridCellEventArgs>

CellMouseMove

Mouse moved over a cell.

public event EventHandler<NoxGridCellMouseEventArgs> CellMouseMove

Event Type

EventHandler<NoxGridCellMouseEventArgs>

CellMouseUp

Mouse button released over a cell or header.

public event EventHandler<NoxGridCellMouseEventArgs> CellMouseUp

Event Type

EventHandler<NoxGridCellMouseEventArgs>

CellPainting

Used to draw cell content yourself. Set Handled = True to skip default drawing.

public event EventHandler<NoxGridCellPaintingEventArgs> CellPainting

Event Type

EventHandler<NoxGridCellPaintingEventArgs>

CellPasting

Occurs for each cell before a pasted value is stored. e.Cancel skips that cell; e.Value changes the value. Not raised for read-only cells.

public event EventHandler<NoxGridCellPastingEventArgs> CellPasting

Event Type

EventHandler<NoxGridCellPastingEventArgs>

CellToolTipTextNeeded

Occurs before a cell or header tooltip is shown. Set ToolTipText to give each cell its own text (empty: no tooltip).

public event EventHandler<NoxGridCellToolTipTextNeededEventArgs> CellToolTipTextNeeded

Event Type

EventHandler<NoxGridCellToolTipTextNeededEventArgs>

CellValidating

Occurs before an edited value is committed. Set Cancel to keep editing.

public event EventHandler<NoxGridCellValidatingEventArgs> CellValidating

Event Type

EventHandler<NoxGridCellValidatingEventArgs>

CellValueChanged

Occurs when a cell value changes.

public event EventHandler<NoxGridCellEventArgs> CellValueChanged

Event Type

EventHandler<NoxGridCellEventArgs>

ColumnDisplayIndexChanged

Occurs when the column order changes.

public event EventHandler<NoxGridColumnEventArgs> ColumnDisplayIndexChanged

Event Type

EventHandler<NoxGridColumnEventArgs>

ColumnHeaderMouseClick

Column header clicked (also non-sortable columns and the right button; not resizing or the filter button). Comes before sorting; e.Handled = True skips sorting.

public event EventHandler<NoxGridCellMouseEventArgs> ColumnHeaderMouseClick

Event Type

EventHandler<NoxGridCellMouseEventArgs>

ColumnHeaderMouseDoubleClick

Column header double-clicked.

public event EventHandler<NoxGridCellMouseEventArgs> ColumnHeaderMouseDoubleClick

Event Type

EventHandler<NoxGridCellMouseEventArgs>

ColumnHeaderPainting

Occurs just before a column header is drawn. Set Handled = True to skip the default text, sort glyph and filter button.

public event EventHandler<NoxGridColumnHeaderPaintingEventArgs> ColumnHeaderPainting

Event Type

EventHandler<NoxGridColumnHeaderPaintingEventArgs>

ColumnVisibleChanged

Occurs when a column's Visible changes (code or the header menu).

public event EventHandler<NoxGridColumnEventArgs> ColumnVisibleChanged

Event Type

EventHandler<NoxGridColumnEventArgs>

ColumnWidthChanged

Occurs when a column width changes.

public event EventHandler<NoxGridColumnEventArgs> ColumnWidthChanged

Event Type

EventHandler<NoxGridColumnEventArgs>

CurrentCellChanged

Occurs when the current cell changes.

public event EventHandler CurrentCellChanged

Event Type

EventHandler

CurrentRowChanged

Occurs only when the current row changes (not when moving to another cell in the same row). Use it to reload row details.

public event EventHandler CurrentRowChanged

Event Type

EventHandler

DataBindingComplete

Occurs when data binding finishes (after columns are generated and rows filled; for a grid on a hidden tab, when the binding actually happens). Rename, hide or reorder columns here.

public event EventHandler<NoxGridBindingCompleteEventArgs> DataBindingComplete

Event Type

EventHandler<NoxGridBindingCompleteEventArgs>

DataError

Occurs when edited text cannot be converted to a value or written to the data source.

public event EventHandler<NoxGridDataErrorEventArgs> DataError

Event Type

EventHandler<NoxGridDataErrorEventArgs>

DataSourceChanged

Occurs when DataSource changes.

public event EventHandler DataSourceChanged

Event Type

EventHandler

DefaultValuesNeeded

Occurs just before the user first edits, checks or pastes into the new-row slot (AllowUserToAddRows). Put default values into e.Row (the row then becomes a real row).

public event EventHandler<NoxGridRowEventArgs> DefaultValuesNeeded

Event Type

EventHandler<NoxGridRowEventArgs>

EditingControlShowing

Occurs just before the editor (TextBox or ComboBox) is shown. Use it to attach editor events.

public event EventHandler<NoxGridEditingControlShowingEventArgs> EditingControlShowing

Event Type

EventHandler<NoxGridEditingControlShowingEventArgs>

FilterChanged

Occurs when a filter changes.

public event EventHandler FilterChanged

Event Type

EventHandler

FooterValueNeeded

Raised for each column when the footer is calculated. Change e.Value to show your own value.

public event EventHandler<NoxGridFooterValueEventArgs> FooterValueNeeded

Event Type

EventHandler<NoxGridFooterValueEventArgs>

HeaderCheckChanged

Occurs after the header check box changed the rows (CellValueChanged is also raised for each row).

public event EventHandler<NoxGridHeaderCheckEventArgs> HeaderCheckChanged

Event Type

EventHandler<NoxGridHeaderCheckEventArgs>

HeaderCheckChanging

Occurs before the header check box of a check box column changes all rows (set e.Cancel to cancel).

public event EventHandler<NoxGridHeaderCheckEventArgs> HeaderCheckChanging

Event Type

EventHandler<NoxGridHeaderCheckEventArgs>

Pasted

Occurs once after a paste (the pasted area and the number of changed cells). Undo reverts the whole paste at once.

public event EventHandler<NoxGridPastedEventArgs> Pasted

Event Type

EventHandler<NoxGridPastedEventArgs>

RowGroupsChanged

Occurs when a row group is collapsed or expanded.

public event EventHandler RowGroupsChanged

Event Type

EventHandler

RowHeaderMouseClick

Row header clicked (any button). The row is still selected as usual.

public event EventHandler<NoxGridCellMouseEventArgs> RowHeaderMouseClick

Event Type

EventHandler<NoxGridCellMouseEventArgs>

RowHeaderMouseDoubleClick

Row header double-clicked.

public event EventHandler<NoxGridCellMouseEventArgs> RowHeaderMouseDoubleClick

Event Type

EventHandler<NoxGridCellMouseEventArgs>

RowsAdded

Occurs after rows are added (unbound add, insert or RowCount increase; bound item added).

public event EventHandler<NoxGridRowsEventArgs> RowsAdded

Event Type

EventHandler<NoxGridRowsEventArgs>

RowsRemoved

Occurs after rows are removed (unbound remove or RowCount decrease; bound item deleted).

public event EventHandler<NoxGridRowsEventArgs> RowsRemoved

Event Type

EventHandler<NoxGridRowsEventArgs>

Scroll

Occurs after scrolling vertically or horizontally. Use it to realign controls placed over the grid with GetCellBounds.

public event EventHandler<NoxGridScrollEventArgs> Scroll

Event Type

EventHandler<NoxGridScrollEventArgs>

SelectionChanged

Occurs when the selection changes.

public event EventHandler SelectionChanged

Event Type

EventHandler

SortCompare

Occurs when the grid compares two cells while sorting (unbound grid). Set SortResult and Handled = True. Return the ascending result; the grid reverses it for descending (as in DataGridView). 0 keeps the current order.

public event EventHandler<NoxGridSortCompareEventArgs> SortCompare

Event Type

EventHandler<NoxGridSortCompareEventArgs>

Sorted

Occurs after sorting finishes (header click, Sort or ClearSort).

public event EventHandler Sorted

Event Type

EventHandler

Sorting

Occurs before sorting by a header click.

public event EventHandler<NoxGridSortingEventArgs> Sorting

Event Type

EventHandler<NoxGridSortingEventArgs>

UndoStateChanged

Occurs when the availability of undo or redo changes.

public event EventHandler UndoStateChanged

Event Type

EventHandler

UserAddedRow

Occurs when a value entered in the new-row slot adds a row (AllowUserToAddRows).

public event EventHandler<NoxGridRowsEventArgs> UserAddedRow

Event Type

EventHandler<NoxGridRowsEventArgs>

UserDeletedRow

Occurs after a row is deleted with the Delete key.

public event EventHandler<NoxGridRowsEventArgs> UserDeletedRow

Event Type

EventHandler<NoxGridRowsEventArgs>

UserDeletingRow

Occurs before a row is deleted with the Delete key (DeleteKeyAction = DeleteRows). Set Cancel to keep the row.

public event EventHandler<NoxGridRowCancelEventArgs> UserDeletingRow

Event Type

EventHandler<NoxGridRowCancelEventArgs>