Class NoxGrid
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
AllowFiltering
Shows filter buttons in column headers to filter rows by value list or search. Default: False.
public bool AllowFiltering { get; set; }
Property Value
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
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
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
AllowUndo
Enables undo and redo with Ctrl+Z / Ctrl+Y. On by default.
public bool AllowUndo { get; set; }
Property Value
AllowUserFormulas
Allows the user to type or paste formulas starting with = into cells.
public bool AllowUserFormulas { get; set; }
Property Value
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
AllowUserToHideColumns
Right-clicking a column header shows a checked list of columns to show or hide.
public bool AllowUserToHideColumns { get; set; }
Property Value
AllowUserToOrderColumns
Allows reordering columns by dragging headers. Default: False.
public bool AllowUserToOrderColumns { get; set; }
Property Value
AllowUserToResizeColumns
Allows resizing columns by dragging header borders. Default: True.
public bool AllowUserToResizeColumns { get; set; }
Property Value
AlternatingRowBackColor
Background color of even rows (second, fourth, …).
public Color AlternatingRowBackColor { get; set; }
Property Value
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
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
CanRedo
Whether there is an undone action to redo.
[Browsable(false)]
public bool CanRedo { get; }
Property Value
CanUndo
Whether there is a step to undo.
[Browsable(false)]
public bool CanUndo { get; }
Property Value
CellBackColor
Cell background color. The empty area without rows is painted with BackColor.
public Color CellBackColor { get; set; }
Property Value
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
Cells
Cell access: Cells[row, column].Value
[Browsable(false)]
public NoxGridCellCollection Cells { get; }
Property Value
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
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
Columns
Gets the collection of columns.
public NoxGridColumnCollection Columns { get; }
Property Value
ConditionalFormats
Conditional formatting rules (rules higher in the list take precedence). Editable in the designer property grid.
public NoxConditionalFormatCollection ConditionalFormats { get; }
Property Value
CopyIncludesHeaders
Includes the header row when copying (Ctrl+C). Default: False.
public bool CopyIncludesHeaders { get; set; }
Property Value
CreateParams
protected override CreateParams CreateParams { get; }
Property Value
CurrentCell
Gets the current cell (null if none).
[Browsable(false)]
public NoxGridCell CurrentCell { get; }
Property Value
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
CurrentColumnIndex
Gets the Columns index of the current column (-1 if none).
[Browsable(false)]
public int CurrentColumnIndex { get; }
Property Value
CurrentRowIndex
Gets the current row (data row index; -1 if none).
[Browsable(false)]
public int CurrentRowIndex { get; }
Property Value
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
DataSource
Data source: DataTable, DataView, DataSet (+DataMember), BindingSource, IList, IListSource, or an INoxVirtualDataSource for virtual mode.
public object DataSource { get; set; }
Property Value
DefaultSize
protected override Size DefaultSize { get; }
Property Value
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
DisplayedRowCount
Number of rows fully visible on one screen (excluding frozen rows)
[Browsable(false)]
public int DisplayedRowCount { get; }
Property Value
EditMode
How cell editing starts. Default: NoxGridEditMode.EditOnKeystrokeOrF2.
public NoxGridEditMode EditMode { get; set; }
Property Value
EditingControl
Gets the editing control (TextBox or ComboBox; null if none).
[Browsable(false)]
public Control EditingControl { get; }
Property Value
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
FirstDisplayedRowIndex
Gets or sets the topmost visible row in the scrolling area (data row index).
[Browsable(false)]
public int FirstDisplayedRowIndex { get; set; }
Property Value
FooterVisible
Shows the footer (summary) row fixed at the bottom. Set FooterFunction on the columns.
public bool FooterVisible { get; set; }
Property Value
FrozenRowCount
Number of rows kept at the top while scrolling vertically. Default: 0.
public int FrozenRowCount { get; set; }
Property Value
GridLineColor
Grid line color.
public Color GridLineColor { get; set; }
Property Value
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
HeaderBackColor
Header background color.
public Color HeaderBackColor { get; set; }
Property Value
HeaderBold
Draws column header text in bold. Default: False.
public bool HeaderBold { get; set; }
Property Value
HeaderFont
Font of the column headers. Empty uses the grid font (bold with HeaderBold). Default: Nothing.
public Font HeaderFont { get; set; }
Property Value
HeaderForeColor
Header text color.
public Color HeaderForeColor { get; set; }
Property Value
HeaderHeight
Header height (px at 96 DPI). Default: 28.
public int HeaderHeight { get; set; }
Property Value
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
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
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
HorizontalScrollingOffset
Gets or sets the horizontal scroll offset (px, area excluding frozen columns).
[Browsable(false)]
public int HorizontalScrollingOffset { get; set; }
Property Value
IsCurrentCellInEditMode
Gets whether the current cell is being edited.
[Browsable(false)]
public bool IsCurrentCellInEditMode { get; }
Property Value
IsUpdating
Whether a BeginUpdate block is open.
[Browsable(false)]
public bool IsUpdating { get; }
Property Value
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
Property Value
this[int, string]
Cell value (by column name)
[Browsable(false)]
public object this[int rowIndex, string columnName] { get; set; }
Parameters
Property Value
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
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
MultiSelect
Allows selecting multiple cells with Ctrl, Shift and dragging. Default: True.
public bool MultiSelect { get; set; }
Property Value
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
PrintSettings
Gets the print settings.
[Browsable(false)]
public NoxPrintSettings PrintSettings { get; set; }
Property Value
ReadOnly
Prevents the user from changing cell values. Default: False.
public bool ReadOnly { get; set; }
Property Value
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
ReadOnlyForeColor
Text color of read-only cells. Empty draws them like other cells.
public Color ReadOnlyForeColor { get; set; }
Property Value
RedoActionName
Name of the action Redo would repeat (empty if none).
[Browsable(false)]
public string RedoActionName { get; }
Property Value
RowCount
Gets or sets the number of rows. Can be changed only in unbound mode.
public int RowCount { get; set; }
Property Value
RowGroups
Row groups (in order of start row)
[Browsable(false)]
public IReadOnlyList<NoxRowGroup> RowGroups { get; }
Property Value
RowHeadersVisible
Shows row headers (row numbers). Default: False.
public bool RowHeadersVisible { get; set; }
Property Value
RowHeadersWidth
Row header width (px at 96 DPI). Default: 44.
public int RowHeadersWidth { get; set; }
Property Value
RowHeight
Row height (px at 96 DPI). Default: 24.
public int RowHeight { get; set; }
Property Value
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
Rows
Row collection: Add, Insert, RemoveAt, Clear; per-row height, visibility and colors
[Browsable(false)]
public NoxGridRowCollection Rows { get; }
Property Value
SelectFirstRowOnBind
After binding or filling, makes the first row current (like DataGridView). Off by default.
public bool SelectFirstRowOnBind { get; set; }
Property Value
SelectedCellCount
Number of selected cells
[Browsable(false)]
public int SelectedCellCount { get; }
Property Value
SelectionBackColor
Background color of selected cells.
public Color SelectionBackColor { get; set; }
Property Value
SelectionForeColor
Text color of selected cells.
public Color SelectionForeColor { get; set; }
Property Value
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
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
ShowCellToolTips
Shows truncated cell text and header descriptions as tooltips. Default: True.
public bool ShowCellToolTips { get; set; }
Property Value
ShowGridLines
Draws grid lines. Default: True.
public bool ShowGridLines { get; set; }
Property Value
ShowHeaders
Shows column headers. Default: True.
public bool ShowHeaders { get; set; }
Property Value
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
SortColumns
Current sort columns (in priority order). Each column's direction is its SortOrder.
[Browsable(false)]
public IReadOnlyList<NoxGridColumn> SortColumns { get; }
Property Value
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
Spans
Explicit merge list
[Browsable(false)]
public IReadOnlyList<NoxGridSpan> Spans { get; }
Property Value
UndoActionName
Name of the next action to undo (e.g. "Edit", "Paste")
[Browsable(false)]
public string UndoActionName { get; }
Property Value
UndoLimit
Number of undo steps to keep. Default: 100.
public int UndoLimit { get; set; }
Property Value
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
VerticalGridLines
Draws vertical grid lines. False draws horizontal lines only (list style). Default: True.
public bool VerticalGridLines { get; set; }
Property Value
VisibleRowCount
Number of rows shown on screen (excluding hidden and filtered rows)
[Browsable(false)]
public int VisibleRowCount { get; }
Property Value
Methods
AddRow()
Unbound mode: appends an empty row and returns the new row index.
public int AddRow()
Returns
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
Returns
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
groupColumnNoxGridColumnfunctionNoxSubtotalFunctionvalueColumnsNoxGridColumn[]
Returns
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
groupColumnNamestringfunctionNoxSubtotalFunctionvalueColumnNamesstring[]
Returns
ApplyColorScheme(NoxGridColorScheme)
Applies a color scheme.
public void ApplyColorScheme(NoxGridColorScheme scheme)
Parameters
schemeNoxGridColorScheme
ApplyColorSettings(string)
Applies colors from GetColorSettings: the scheme first, then each saved color. Unknown entries are ignored.
public void ApplyColorSettings(string settings)
Parameters
settingsstring
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
AutoResizeColumn(int)
Adjusts the column width to fit the header and the text of the visible rows.
public void AutoResizeColumn(int columnIndex)
Parameters
columnIndexint
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
rowIndexint
AutoResizeRows()
Fits all row heights to their content.
public void AutoResizeRows()
BeginEdit(bool)
Starts editing the current cell.
public bool BeginEdit(bool selectAll)
Parameters
selectAllbool
Returns
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
namestring
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
columnNoxGridColumn
Returns
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
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
selectedCellsbool
ClearFilter(NoxGridColumn)
Removes the filter of one column.
public void ClearFilter(NoxGridColumn column)
Parameters
columnNoxGridColumn
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
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
restoreOriginalOrderbool
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
groupNoxRowGroup
CopyToClipboard()
Copies the selected cells to the clipboard (Ctrl+C).
public void CopyToClipboard()
CreateAccessibilityInstance()
protected override AccessibleObject CreateAccessibilityInstance()
Returns
CreatePrintDocument()
Document for printing (when working with PrintDocument directly).
public PrintDocument CreatePrintDocument()
Returns
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposingbool
EndEdit()
Commits the edited value. Returns False if validation or conversion fails (editing continues).
public bool EndEdit()
Returns
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
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
formulastring
Returns
ExpandAll()
Expands every row group.
public void ExpandAll()
ExpandGroup(NoxRowGroup)
Expands a row group (shows its detail rows).
public void ExpandGroup(NoxRowGroup group)
Parameters
groupNoxRowGroup
ExportToCsv(Stream, NoxExportOptions)
Writes the grid as CSV (UTF-8) to a stream.
public void ExportToCsv(Stream stream, NoxExportOptions options)
Parameters
streamStreamoptionsNoxExportOptions
ExportToCsv(string)
Saves the grid as a CSV file (UTF-8) with default options.
public void ExportToCsv(string path)
Parameters
pathstring
ExportToCsv(string, NoxExportOptions)
Saves the grid as a CSV file (UTF-8).
public void ExportToCsv(string path, NoxExportOptions options)
Parameters
pathstringoptionsNoxExportOptions
ExportToExcel(Stream, NoxExportOptions)
Writes an Excel workbook (.xlsx). Built with Office Open XML, without external libraries.
public void ExportToExcel(Stream stream, NoxExportOptions options)
Parameters
streamStreamoptionsNoxExportOptions
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
pathstring
ExportToExcel(string, NoxExportOptions)
Saves the grid as an Excel file (.xlsx).
public void ExportToExcel(string path, NoxExportOptions options)
Parameters
pathstringoptionsNoxExportOptions
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
textstring
Returns
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
textstringoptionsNoxFindOptions
Returns
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
Returns
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
Returns
GetClipboardText(bool)
Returns the selected cells as tab-delimited text (cells outside the selection are empty).
public string GetClipboardText(bool includeHeaders)
Parameters
includeHeadersbool
Returns
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
GetCsvText(NoxExportOptions)
CSV text (without BOM)
public string GetCsvText(NoxExportOptions options)
Parameters
optionsNoxExportOptions
Returns
GetFooterValue(NoxGridColumn)
Footer value of the column (calculated by FooterFunction; FooterValueNeeded can change it)
public object GetFooterValue(NoxGridColumn column)
Parameters
columnNoxGridColumn
Returns
GetFooterValue(string)
Footer value of the column with this name
public object GetFooterValue(string columnName)
Parameters
columnNamestring
Returns
GetFormula(int, int)
Returns the cell formula ("=…"), or Nothing if the cell has no formula.
public string GetFormula(int rowIndex, int columnIndex)
Parameters
Returns
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
Returns
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
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
Returns
GetText(int, int)
Display text
public string GetText(int rowIndex, int columnIndex)
Parameters
Returns
GetText(int, string)
Text shown in a cell, by column name.
public string GetText(int rowIndex, string columnName)
Parameters
Returns
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
Returns
GetValue(int, int)
Value of a cell.
public object GetValue(int rowIndex, int columnIndex)
Parameters
Returns
GetValue(int, string)
Value of a cell by column name.
public object GetValue(int rowIndex, string columnName)
Parameters
Returns
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
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
Returns
HasFormula(int, int)
Whether the cell has a formula.
public bool HasFormula(int rowIndex, int columnIndex)
Parameters
Returns
HitTest(int, int)
Hit test (merged cells report the top-left cell).
public NoxGridHitTestInfo HitTest(int x, int y)
Parameters
Returns
ImportCsvText(string, NoxImportOptions)
Imports CSV text (from the clipboard or a string).
public void ImportCsvText(string text, NoxImportOptions options)
Parameters
textstringoptionsNoxImportOptions
ImportFromCsv(Stream, NoxImportOptions)
Imports CSV (delimited text).
public void ImportFromCsv(Stream stream, NoxImportOptions options)
Parameters
streamStreamoptionsNoxImportOptions
ImportFromCsv(string)
Loads a CSV file into the grid with default options.
public void ImportFromCsv(string path)
Parameters
pathstring
ImportFromCsv(string, NoxImportOptions)
Loads a CSV file into the grid.
public void ImportFromCsv(string path, NoxImportOptions options)
Parameters
pathstringoptionsNoxImportOptions
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
streamStreamoptionsNoxImportOptions
ImportFromExcel(string)
Loads the first sheet of an Excel file (.xlsx) into the grid with default options.
public void ImportFromExcel(string path)
Parameters
pathstring
ImportFromExcel(string, NoxImportOptions)
Loads a sheet of an Excel file (.xlsx) into the grid.
public void ImportFromExcel(string path, NoxImportOptions options)
Parameters
pathstringoptionsNoxImportOptions
InsertRows(int, int)
Unbound mode: inserts an empty row at index.
public void InsertRows(int index, int count)
Parameters
InvalidateCell(int, int)
Redraws a cell.
public void InvalidateCell(int rowIndex, int columnIndex)
Parameters
InvalidateRow(int)
Redraws a row.
public void InvalidateRow(int rowIndex)
Parameters
rowIndexint
IsCellSelected(int, int)
Whether the cell is selected.
public bool IsCellSelected(int rowIndex, int columnIndex)
Parameters
Returns
IsInputKey(Keys)
protected override bool IsInputKey(Keys keyData)
Parameters
keyDataKeys
Returns
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
rowIndexint
Returns
IsRowVisible(int)
Whether the row is shown on screen (considering hidden and filtered state)
public bool IsRowVisible(int rowIndex)
Parameters
rowIndexint
Returns
IsSubtotalRow(int)
Whether the row is a subtotal row (added by AddSubtotals)
public bool IsSubtotalRow(int rowIndex)
Parameters
rowIndexint
Returns
OnBindingContextChanged(EventArgs)
Raises the BindingContextChanged event.
protected override void OnBindingContextChanged(EventArgs e)
Parameters
OnCellBeginEdit(NoxGridCellCancelEventArgs)
Raises the CellBeginEdit event.
protected virtual void OnCellBeginEdit(NoxGridCellCancelEventArgs e)
Parameters
OnCellButtonClick(NoxGridCellEventArgs)
Raises the CellButtonClick event.
protected virtual void OnCellButtonClick(NoxGridCellEventArgs e)
Parameters
OnCellClick(NoxGridCellEventArgs)
Raises the CellClick event.
protected virtual void OnCellClick(NoxGridCellEventArgs e)
Parameters
OnCellContentClick(NoxGridCellEventArgs)
Raises the CellContentClick event.
protected virtual void OnCellContentClick(NoxGridCellEventArgs e)
Parameters
OnCellContentDoubleClick(NoxGridCellEventArgs)
Raises the CellContentDoubleClick event.
protected virtual void OnCellContentDoubleClick(NoxGridCellEventArgs e)
Parameters
OnCellDoubleClick(NoxGridCellEventArgs)
Raises the CellDoubleClick event.
protected virtual void OnCellDoubleClick(NoxGridCellEventArgs e)
Parameters
OnCellEndEdit(NoxGridCellEventArgs)
Raises the CellEndEdit event.
protected virtual void OnCellEndEdit(NoxGridCellEventArgs e)
Parameters
OnCellFormatting(NoxGridCellFormattingEventArgs)
Raises the CellFormatting event.
protected virtual void OnCellFormatting(NoxGridCellFormattingEventArgs e)
Parameters
OnCellMouseClick(NoxGridCellMouseEventArgs)
Raises the CellMouseClick event.
protected virtual void OnCellMouseClick(NoxGridCellMouseEventArgs e)
Parameters
OnCellMouseDoubleClick(NoxGridCellMouseEventArgs)
Raises the CellMouseDoubleClick event.
protected virtual void OnCellMouseDoubleClick(NoxGridCellMouseEventArgs e)
Parameters
OnCellMouseDown(NoxGridCellMouseEventArgs)
Raises the CellMouseDown event.
protected virtual void OnCellMouseDown(NoxGridCellMouseEventArgs e)
Parameters
OnCellMouseEnter(NoxGridCellEventArgs)
Raises the CellMouseEnter event.
protected virtual void OnCellMouseEnter(NoxGridCellEventArgs e)
Parameters
OnCellMouseLeave(NoxGridCellEventArgs)
Raises the CellMouseLeave event.
protected virtual void OnCellMouseLeave(NoxGridCellEventArgs e)
Parameters
OnCellMouseMove(NoxGridCellMouseEventArgs)
Raises the CellMouseMove event.
protected virtual void OnCellMouseMove(NoxGridCellMouseEventArgs e)
Parameters
OnCellMouseUp(NoxGridCellMouseEventArgs)
Raises the CellMouseUp event.
protected virtual void OnCellMouseUp(NoxGridCellMouseEventArgs e)
Parameters
OnCellPainting(NoxGridCellPaintingEventArgs)
Raises the CellPainting event.
protected virtual void OnCellPainting(NoxGridCellPaintingEventArgs e)
Parameters
OnCellToolTipTextNeeded(NoxGridCellToolTipTextNeededEventArgs)
Raises the CellToolTipTextNeeded event.
protected virtual void OnCellToolTipTextNeeded(NoxGridCellToolTipTextNeededEventArgs e)
Parameters
OnCellValidating(NoxGridCellValidatingEventArgs)
Raises the CellValidating event.
protected virtual void OnCellValidating(NoxGridCellValidatingEventArgs e)
Parameters
OnCellValueChanged(NoxGridCellEventArgs)
Raises the CellValueChanged event.
protected virtual void OnCellValueChanged(NoxGridCellEventArgs e)
Parameters
OnColumnDisplayIndexChanged(NoxGridColumnEventArgs)
Raises the ColumnDisplayIndexChanged event.
protected virtual void OnColumnDisplayIndexChanged(NoxGridColumnEventArgs e)
Parameters
OnColumnHeaderMouseClick(NoxGridCellMouseEventArgs)
Raises the ColumnHeaderMouseClick event.
protected virtual void OnColumnHeaderMouseClick(NoxGridCellMouseEventArgs e)
Parameters
OnColumnHeaderMouseDoubleClick(NoxGridCellMouseEventArgs)
Raises the ColumnHeaderMouseDoubleClick event.
protected virtual void OnColumnHeaderMouseDoubleClick(NoxGridCellMouseEventArgs e)
Parameters
OnColumnHeaderPainting(NoxGridColumnHeaderPaintingEventArgs)
Raises the ColumnHeaderPainting event.
protected virtual void OnColumnHeaderPainting(NoxGridColumnHeaderPaintingEventArgs e)
Parameters
OnColumnWidthChanged(NoxGridColumnEventArgs)
Raises the ColumnWidthChanged event.
protected virtual void OnColumnWidthChanged(NoxGridColumnEventArgs e)
Parameters
OnCurrentCellChanged(EventArgs)
Raises the CurrentCellChanged event.
protected virtual void OnCurrentCellChanged(EventArgs e)
Parameters
OnCurrentRowChanged(EventArgs)
Raises the CurrentRowChanged event.
protected virtual void OnCurrentRowChanged(EventArgs e)
Parameters
OnDataBindingComplete(NoxGridBindingCompleteEventArgs)
Raises the DataBindingComplete event.
protected virtual void OnDataBindingComplete(NoxGridBindingCompleteEventArgs e)
Parameters
OnDataError(NoxGridDataErrorEventArgs)
Raises the DataError event.
protected virtual void OnDataError(NoxGridDataErrorEventArgs e)
Parameters
OnDataSourceChanged(EventArgs)
Raises the DataSourceChanged event.
protected virtual void OnDataSourceChanged(EventArgs e)
Parameters
OnDpiChangedAfterParent(EventArgs)
Raises the DpiChangedAfterParent event.
protected override void OnDpiChangedAfterParent(EventArgs e)
Parameters
OnEditingControlShowing(NoxGridEditingControlShowingEventArgs)
Raises the EditingControlShowing event.
protected virtual void OnEditingControlShowing(NoxGridEditingControlShowingEventArgs e)
Parameters
OnFilterChanged(EventArgs)
Raises the FilterChanged event.
protected virtual void OnFilterChanged(EventArgs e)
Parameters
OnFontChanged(EventArgs)
Raises the FontChanged event.
protected override void OnFontChanged(EventArgs e)
Parameters
OnFooterValueNeeded(NoxGridFooterValueEventArgs)
Raises the FooterValueNeeded event.
protected virtual void OnFooterValueNeeded(NoxGridFooterValueEventArgs e)
Parameters
OnGotFocus(EventArgs)
Raises the GotFocus event.
protected override void OnGotFocus(EventArgs e)
Parameters
OnHandleCreated(EventArgs)
Raises the HandleCreated event.
protected override void OnHandleCreated(EventArgs e)
Parameters
OnKeyDown(KeyEventArgs)
Raises the KeyDown event.
protected override void OnKeyDown(KeyEventArgs e)
Parameters
OnKeyPress(KeyPressEventArgs)
Raises the KeyPress event.
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
OnLostFocus(EventArgs)
Raises the LostFocus event.
protected override void OnLostFocus(EventArgs e)
Parameters
OnMouseCaptureChanged(EventArgs)
Raises the MouseCaptureChanged event.
protected override void OnMouseCaptureChanged(EventArgs e)
Parameters
OnMouseDoubleClick(MouseEventArgs)
Raises the MouseDoubleClick event.
protected override void OnMouseDoubleClick(MouseEventArgs e)
Parameters
OnMouseDown(MouseEventArgs)
Raises the MouseDown event.
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseLeave(EventArgs)
Raises the MouseLeave event.
protected override void OnMouseLeave(EventArgs e)
Parameters
OnMouseMove(MouseEventArgs)
Raises the MouseMove event.
protected override void OnMouseMove(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Raises the MouseUp event.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
OnMouseWheel(MouseEventArgs)
Raises the MouseWheel event.
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
OnPaint(PaintEventArgs)
Raises the Paint event.
protected override void OnPaint(PaintEventArgs e)
Parameters
OnPaintBackground(PaintEventArgs)
Raises the PaintBackground event.
protected override void OnPaintBackground(PaintEventArgs e)
Parameters
OnResize(EventArgs)
Raises the Resize event.
protected override void OnResize(EventArgs e)
Parameters
OnRowHeaderMouseClick(NoxGridCellMouseEventArgs)
Raises the RowHeaderMouseClick event.
protected virtual void OnRowHeaderMouseClick(NoxGridCellMouseEventArgs e)
Parameters
OnRowHeaderMouseDoubleClick(NoxGridCellMouseEventArgs)
Raises the RowHeaderMouseDoubleClick event.
protected virtual void OnRowHeaderMouseDoubleClick(NoxGridCellMouseEventArgs e)
Parameters
OnRowsAdded(NoxGridRowsEventArgs)
Raises the RowsAdded event.
protected virtual void OnRowsAdded(NoxGridRowsEventArgs e)
Parameters
OnRowsRemoved(NoxGridRowsEventArgs)
Raises the RowsRemoved event.
protected virtual void OnRowsRemoved(NoxGridRowsEventArgs e)
Parameters
OnScroll(NoxGridScrollEventArgs)
Raises the Scroll event.
protected virtual void OnScroll(NoxGridScrollEventArgs e)
Parameters
OnSelectionChanged(EventArgs)
Raises the SelectionChanged event.
protected virtual void OnSelectionChanged(EventArgs e)
Parameters
OnSortCompare(NoxGridSortCompareEventArgs)
Raises the SortCompare event.
protected virtual void OnSortCompare(NoxGridSortCompareEventArgs e)
Parameters
OnSorted(EventArgs)
Raises the Sorted event.
protected virtual void OnSorted(EventArgs e)
Parameters
OnSorting(NoxGridSortingEventArgs)
Raises the Sorting event.
protected virtual void OnSorting(NoxGridSortingEventArgs e)
Parameters
OnUndoStateChanged(EventArgs)
Raises the UndoStateChanged event.
protected virtual void OnUndoStateChanged(EventArgs e)
Parameters
OnUserAddedRow(NoxGridRowsEventArgs)
Raises the UserAddedRow event.
protected virtual void OnUserAddedRow(NoxGridRowsEventArgs e)
Parameters
OnUserDeletedRow(NoxGridRowsEventArgs)
Raises the UserDeletedRow event.
protected virtual void OnUserDeletedRow(NoxGridRowsEventArgs e)
Parameters
OnUserDeletingRow(NoxGridRowCancelEventArgs)
Raises the UserDeletingRow event.
protected virtual void OnUserDeletingRow(NoxGridRowCancelEventArgs e)
Parameters
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
textstring
Returns
PasteFromClipboard()
Pastes clipboard text starting at the current cell (Ctrl+V).
public int PasteFromClipboard()
Returns
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
showDialogbool
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
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
RemoveSelectedRows()
Removes the rows spanned by the selection (bound: deletes them from the data source).
public int RemoveSelectedRows()
Returns
RemoveSpans(int, int, int, int)
Removes merges that overlap the range.
public void RemoveSpans(int rowIndex, int columnIndex, int rowCount, int columnCount)
Parameters
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
findstringreplacementstringoptionsNoxFindOptions
Returns
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
findstringreplacementstringoptionsNoxFindOptions
Returns
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
SelectRow(int, bool)
Selects a row. add = True adds to the existing selection.
public void SelectRow(int rowIndex, bool add)
Parameters
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
columnNoxGridCheckBoxColumncheckbool
Returns
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
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
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
columnNoxGridColumnallowedTextsIEnumerable<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
columnNoxGridColumnpredicatePredicate<object>
SetFilterContains(NoxGridColumn, string)
Shows only rows whose display text contains text (case-insensitive).
public void SetFilterContains(NoxGridColumn column, string text)
Parameters
columnNoxGridColumntextstring
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
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
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
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
SetValue(int, int, object)
Sets the value of a cell.
public void SetValue(int rowIndex, int columnIndex, object value)
Parameters
SetValue(int, string, object)
Sets the value of a cell by column name.
public void SetValue(int rowIndex, string columnName, object value)
Parameters
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
ShowColumnMenu(Point)
Shows the column show/hide menu at a point (grid coordinates).
public void ShowColumnMenu(Point location)
Parameters
locationPoint
ShowExportDialog()
Shows a save-file dialog and saves as CSV or Excel. Returns the saved path (null if canceled).
public string ShowExportDialog()
Returns
ShowFilterPopup(NoxGridColumn)
Opens the header filter popup (can also be called from code).
public void ShowFilterPopup(NoxGridColumn column)
Parameters
columnNoxGridColumn
ShowFindDialog(bool)
Find dialog (replace = True also shows the replace box).
public void ShowFindDialog(bool replace)
Parameters
replacebool
ShowImportDialog()
Shows an open-file dialog and imports Excel or CSV. Returns the opened file path (Nothing if canceled).
public string ShowImportDialog()
Returns
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
levelint
ShowPageSetup()
Page setup dialog (orientation, margins) → applied to PrintSettings.
public bool ShowPageSetup()
Returns
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
columnNoxGridColumnorderNoxSortOrder
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
columnsNoxGridColumn[]ordersNoxSortOrder[]
ToggleGroup(NoxRowGroup)
Collapses the group if expanded, expands it if collapsed.
public void ToggleGroup(NoxRowGroup group)
Parameters
groupNoxRowGroup
Undo()
Undoes the last action.
public bool Undo()
Returns
UngroupRows(int, int)
Ungroups the groups that lie entirely within the range.
public void UngroupRows(int startRow, int count)
Parameters
Validate()
Validates all cells and moves to the first invalid one. Returns the list of invalid cells.
public NoxGridValidationError[] Validate()
Returns
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
selectFirstbool
Returns
WndProc(ref Message)
protected override void WndProc(ref Message m)
Parameters
mMessage
Events
CellBeginEdit
Occurs before cell editing starts. Set Cancel to prevent it.
public event EventHandler<NoxGridCellCancelEventArgs> CellBeginEdit
Event Type
CellButtonClick
Occurs when a button in a button column is clicked.
public event EventHandler<NoxGridCellEventArgs> CellButtonClick
Event Type
CellClick
Occurs when a cell is clicked.
public event EventHandler<NoxGridCellEventArgs> CellClick
Event Type
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
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
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
CellDoubleClick
Occurs when a cell is double-clicked.
public event EventHandler<NoxGridCellEventArgs> CellDoubleClick
Event Type
CellEndEdit
Occurs when cell editing ends (committed or cancelled).
public event EventHandler<NoxGridCellEventArgs> CellEndEdit
Event Type
CellFormatting
Occurs just before a cell is drawn. Text and colors can be changed (conditional formatting).
public event EventHandler<NoxGridCellFormattingEventArgs> CellFormatting
Event Type
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
CellMouseDoubleClick
Cell or header double-clicked (with button and position).
public event EventHandler<NoxGridCellMouseEventArgs> CellMouseDoubleClick
Event Type
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
CellMouseEnter
Mouse entered a cell (headers included).
public event EventHandler<NoxGridCellEventArgs> CellMouseEnter
Event Type
CellMouseLeave
Mouse left a cell (headers included).
public event EventHandler<NoxGridCellEventArgs> CellMouseLeave
Event Type
CellMouseMove
Mouse moved over a cell.
public event EventHandler<NoxGridCellMouseEventArgs> CellMouseMove
Event Type
CellMouseUp
Mouse button released over a cell or header.
public event EventHandler<NoxGridCellMouseEventArgs> CellMouseUp
Event Type
CellPainting
Used to draw cell content yourself. Set Handled = True to skip default drawing.
public event EventHandler<NoxGridCellPaintingEventArgs> CellPainting
Event Type
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
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
CellValidating
Occurs before an edited value is committed. Set Cancel to keep editing.
public event EventHandler<NoxGridCellValidatingEventArgs> CellValidating
Event Type
CellValueChanged
Occurs when a cell value changes.
public event EventHandler<NoxGridCellEventArgs> CellValueChanged
Event Type
ColumnDisplayIndexChanged
Occurs when the column order changes.
public event EventHandler<NoxGridColumnEventArgs> ColumnDisplayIndexChanged
Event Type
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
ColumnHeaderMouseDoubleClick
Column header double-clicked.
public event EventHandler<NoxGridCellMouseEventArgs> ColumnHeaderMouseDoubleClick
Event Type
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
ColumnVisibleChanged
Occurs when a column's Visible changes (code or the header menu).
public event EventHandler<NoxGridColumnEventArgs> ColumnVisibleChanged
Event Type
ColumnWidthChanged
Occurs when a column width changes.
public event EventHandler<NoxGridColumnEventArgs> ColumnWidthChanged
Event Type
CurrentCellChanged
Occurs when the current cell changes.
public event EventHandler CurrentCellChanged
Event Type
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
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
DataError
Occurs when edited text cannot be converted to a value or written to the data source.
public event EventHandler<NoxGridDataErrorEventArgs> DataError
Event Type
DataSourceChanged
Occurs when DataSource changes.
public event EventHandler DataSourceChanged
Event Type
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
EditingControlShowing
Occurs just before the editor (TextBox or ComboBox) is shown. Use it to attach editor events.
public event EventHandler<NoxGridEditingControlShowingEventArgs> EditingControlShowing
Event Type
FilterChanged
Occurs when a filter changes.
public event EventHandler FilterChanged
Event Type
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
HeaderCheckChanged
Occurs after the header check box changed the rows (CellValueChanged is also raised for each row).
public event EventHandler<NoxGridHeaderCheckEventArgs> HeaderCheckChanged
Event Type
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
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
RowGroupsChanged
Occurs when a row group is collapsed or expanded.
public event EventHandler RowGroupsChanged
Event Type
RowHeaderMouseClick
Row header clicked (any button). The row is still selected as usual.
public event EventHandler<NoxGridCellMouseEventArgs> RowHeaderMouseClick
Event Type
RowHeaderMouseDoubleClick
Row header double-clicked.
public event EventHandler<NoxGridCellMouseEventArgs> RowHeaderMouseDoubleClick
Event Type
RowsAdded
Occurs after rows are added (unbound add, insert or RowCount increase; bound item added).
public event EventHandler<NoxGridRowsEventArgs> RowsAdded
Event Type
RowsRemoved
Occurs after rows are removed (unbound remove or RowCount decrease; bound item deleted).
public event EventHandler<NoxGridRowsEventArgs> RowsRemoved
Event Type
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
SelectionChanged
Occurs when the selection changes.
public event EventHandler SelectionChanged
Event Type
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
Sorted
Occurs after sorting finishes (header click, Sort or ClearSort).
public event EventHandler Sorted
Event Type
Sorting
Occurs before sorting by a header click.
public event EventHandler<NoxGridSortingEventArgs> Sorting
Event Type
UndoStateChanged
Occurs when the availability of undo or redo changes.
public event EventHandler UndoStateChanged
Event Type
UserAddedRow
Occurs when a value entered in the new-row slot adds a row (AllowUserToAddRows).
public event EventHandler<NoxGridRowsEventArgs> UserAddedRow
Event Type
UserDeletedRow
Occurs after a row is deleted with the Delete key.
public event EventHandler<NoxGridRowsEventArgs> UserDeletedRow
Event Type
UserDeletingRow
Occurs before a row is deleted with the Delete key (DeleteKeyAction = DeleteRows). Set Cancel to keep the row.
public event EventHandler<NoxGridRowCancelEventArgs> UserDeletingRow