Skip to main content
Table of Contents

TTMSFNCCustomDataGrid Class

Base class of the data grid control: cell data, sorting, grouping, filtering, selection, inline editing, import/export, row/column structure and rendering.

API unit family: TMSFNCDataGrid Inherits from: TTMSFNCDataGridBase Implements: ITMSFNCAppearanceGlobalFont, ITMSFNCDataGridRendererLink, ITMSFNCDataBinderGrid, ITMSFNCCustomReadWriteIO, ITMSFNCBitmapContainer, ITMSFNCDataObject

Syntax

GeneratedPascalC++
TTMSFNCCustomDataGrid = class(TTMSFNCDataGridBase, ITMSFNCAppearanceGlobalFont, ITMSFNCDataGridRendererLink, ITMSFNCDataBinderGrid, ITMSFNCCustomReadWriteIO, ITMSFNCBitmapContainer, ITMSFNCDataObject)
class PASCALIMPLEMENTATION TTMSFNCCustomDataGrid : public TTMSFNCDataGridBase, public ITMSFNCAppearanceGlobalFont, public ITMSFNCDataGridRendererLink, public ITMSFNCDataBinderGrid, public ITMSFNCCustomReadWriteIO, public ITMSFNCBitmapContainer, public ITMSFNCDataObject

Remarks

The grid is a host control around a root renderer (Root, a TTMSFNCDataGridRenderer). Nearly every data, layout and event member of this class forwards to that renderer, so the behaviour documented on the renderer applies here as well. The grid itself adds the header area (visual grouping zone and toolbar bar), the footer area (paging controls and toolbar bar), the design-time overlay and component-level services such as data binding and persistence.

Many properties are declared protected here; use TTMSFNCDataGrid, which publishes them, in forms and frames. Wrap bulk changes in BeginUpdate / EndUpdate to avoid repeated recalculation.

Properties

Name Description
ConditionalFormatting Declarative conditional formatting rules (data bars, colour scales, icon sets, value/text/top-N/average/unique and expression rules) applied to cells before the OnGetCellLayout event.

Methods

Name Description
AddBitmap Turns a cell into a bitmap cell that displays the given bitmap.
AddBitmapColumn Turns every data cell (between the fixed top and bottom rows) of a column into a bitmap cell showing the given bitmap.
AddButton Turns a cell into a button cell.
AddButtonColumn Turns every data cell (between the fixed top and bottom rows) of a column into a button cell.
AddCheckBox Turns a cell into a checkbox cell.
AddCheckBoxColumn Turns every data cell (between the fixed top and bottom rows) of a column into a checkbox cell.
AddColumn Appends one empty column at the right of the grid.
AddDataCheckBox Turns a cell into a data checkbox cell: the check state is derived from, and written to, the cell value itself.
AddDataCheckBoxColumn Turns every data cell (between the fixed top and bottom rows) of a column into a data checkbox cell whose state follows the cell value.
AddDataProgressBar Turns a cell into a data progress bar cell: the bar position is taken from the numeric cell value.
AddDataProgressBarColumn Turns every data cell (between the fixed top and bottom rows) of a column into a data progress bar cell whose position follows the cell value.
AddDataRadioButton Turns a cell into a data radio button cell: the selected state follows the cell value.
AddDataRadioButtonColumn Turns every data cell (between the fixed top and bottom rows) of a column into a data radio button cell.
AddFilterEditor Makes sure a filter editor exists for a cell, creating it on demand.
AddGrid Embeds a nested sub-grid renderer in the specified cell and returns it for further configuration.
AddNodeRow Converts a row into a collapsible node row that owns the rows directly below it.
AddProgressBar Turns a cell into a progress bar cell.
AddProgressBarColumn Turns every data cell (between the fixed top and bottom rows) of a column into a progress bar cell.
AddRadioButton Turns a cell into a radio button cell.
AddRadioButtonColumn Turns every data cell (between the fixed top and bottom rows) of a column into a radio button cell.
AddRow Appends one empty row at the bottom of the grid.
ApplyFilter Evaluates the conditions in Filter (or the filter builder expression when Options.Filtering.Advanced is True) and hides the rows that do not match.
AutoFill Fills a target range by extending the pattern of a source range, like dragging the fill handle.
AutoFillCustomListRemove Removes a single custom auto-fill sequence list by its key.
AutoFillCustomListSet Registers or replaces a custom cyclic auto-fill sequence (for example quarters or project phases).
AutoFillCustomListTryGet Retrieves a custom auto-fill sequence by key.
AutoFillCustomListsClear Removes all custom auto-fill sequence lists registered with AutoFillCustomListSet.
AutoFillCustomListsCount Returns the number of registered custom auto-fill sequence lists.
AutoNumberColumn Fills a column with consecutive integers.
AutoNumberRow Fills a row with consecutive integers.
AutoSizeColumn Resizes a column to the width that fits its cell content.
AutoSizeColumns Resizes every column to the width that fits its cell content.
AutoSizeGrid Resizes every column and every row to fit their content in a single update.
AutoSizeRow Resizes a row to the height that fits its cell content.
AutoSizeRows Resizes every row to the height that fits its cell content.
BaseCell Returns the top-left base cell of the merged range that contains a cell.
CanDeleteColumn Checks whether the specified column can structurally be deleted.
CanDeleteRow Checks whether the specified row can structurally be deleted.
CanInsertColumn Checks whether a column can structurally be inserted at the specified index.
CanInsertRow Checks whether a row can structurally be inserted at the specified index.
CanMergeCells Checks whether a rectangular range can be merged.
CanMoveColumn Checks whether a column can structurally be moved to another index.
CanMoveRow Checks whether a row can structurally be moved to another index.
CanSwapColumn Checks whether two columns can structurally be swapped.
CanSwapRow Checks whether two rows can structurally be swapped.
CancelEditing Closes the active in-place editor without writing its value back to the cell, and returns focus to the grid.
ClearCells Clears the values and per-cell data of every cell in a range.
ClearColumns Removes all items from the Columns collection.
ClearControlCache Clears the shared cache of embedded controls that cells reuse to display control content (checkboxes, buttons, progress bars and similar).
ClearFilter Clears all filter conditions and the filter builder expression, and shows all filtered rows again.
ClearNodeRow Turns a node row back into a normal row.
ClearSelection Deselects all selected cells, rows and columns and clears the focused cell.
CloseFilterPopup Closes the filter drop-down popup if it is open.
CollapseAllNodes Collapses every node row in a single update, hiding all child rows.
CollapseNode Collapses a node row by hiding its child rows.
ColumnAverage Returns the average of the numeric values in a column.
ColumnByHeader Finds the first column whose Header equals the given text.
ColumnByName Finds the first column whose Name equals the given value.
ColumnCalculation Runs a one-off aggregate calculation on a column and writes the result into the grid.
ColumnCustomCalculation Computes a custom aggregate for a column.
ColumnDistinct Returns the number of distinct text values in a column.
ColumnIndexByHeader Returns the index of the first column whose Header equals the given text.
ColumnIndexByName Returns the index of the first column whose Name equals the given value.
ColumnMax Returns the largest numeric value in a column.
ColumnMin Returns the smallest numeric value in a column.
ColumnSpan Returns the number of columns spanned by the merged range a cell belongs to.
ColumnStandardDeviation Returns the standard deviation of the numeric values in a column.
ColumnSum Returns the sum of the numeric values in a column.
CopyToClipboard Copies cells to the system clipboard as tab-delimited text.
CutToClipboard Copies cells to the clipboard with CopyToClipboard and then clears them.
DeleteColumn Removes a column, shifting the following columns to the left.
DeleteColumns Removes consecutive columns, shifting the following columns to the left.
DeleteRow Removes a row, shifting the following rows up.
DeleteRows Removes consecutive rows, shifting the following rows up.
DisplayToRealCell Converts a display cell coordinate to the physical (storage) coordinate.
DisplayToRealColumn Converts a display column index to the physical (storage) column index.
DisplayToRealRow Converts a display row index to the physical (storage) row index.
Draw Paints the grid: the cells of the root renderer, then the footer and the header areas.
EditCell Opens the in-place editor for a cell.
ExpandAllNodes Expands every node row in a single update, showing all child rows.
ExpandNode Expands a node row by showing its child rows.
Find Searches the grid for the given text with default parameters and returns the first matching cell.
FindAll Counts all occurrences of a text and returns the first matching cell.
FindFirst Starts a stateful search from the beginning of the search range; call FindNext to advance to subsequent matches.
FindNext Continues the last search after the previously found cell, reusing its text and parameters.
FirstPage Scrolls to the first page by setting PageIndex to 0.
GetCellKind Returns the area of the grid a cell belongs to: normal, fixed row/column, freeze row/column, or one of the root (corner) areas.
GetCellMergeType Classifies the merge area a cell belongs to.
GetCellObjectForCell Returns the live cell object currently rendered for a cell.
GetCellSize Returns the size of a cell, including the full span when the cell is merged.
GetFilterTypeName Returns the display name of a filter comparison type, as shown in the filter user interface.
GetHMax Returns the maximum value of the horizontal scroll bar.
GetHScrollValue Returns the current horizontal scroll position.
GetHViewPortSize Returns the page (viewport) size of the horizontal scroll bar.
GetMaxLevel Returns the deepest node level stored for any row.
GetParentRow Returns the node row that is the direct parent of a row.
GetRootRow Returns the top-level (level 0) node row above a row.
GetTotalFixedBottomRowHeight Calculates the combined height of the fixed bottom rows.
GetTotalFixedColumnWidth Calculates the combined width of the fixed left columns.
GetTotalFixedRightColumnWidth Calculates the combined width of the fixed right columns.
GetTotalFixedRowHeight Calculates the combined height of the fixed top rows.
GetVMax Returns the maximum value of the vertical scroll bar.
GetVScrollValue Returns the current vertical scroll position.
GetVViewPortSize Returns the page (viewport) size of the vertical scroll bar.
GoToCell Brings a cell into view and optionally selects it.
GoToFirstPage Scrolls to the first page; same as GoToPage(0).
GoToLastPage Scrolls to the last page; same as GoToPage(PageCount - 1).
GoToPage Scrolls so that the first row of the given page becomes the top row.
Group Groups the data rows by the values of a column.
GroupAverage Shows the average of a column for every group.
GroupCalculation Runs an aggregate calculation on a column for every group of grouped data.
GroupCount Shows the number of rows of every group for a column.
GroupCustomCalculation Shows a custom aggregate of a column for every group.
GroupDistinct Shows the number of distinct values of a column for every group.
GroupMax Shows the maximum of a column for every group.
GroupMin Shows the minimum of a column for every group.
GroupSort Sorts the rows inside every group on a column, keeping the groups themselves in place.
GroupStandardDeviation Shows the standard deviation of a column for every group.
GroupSum Shows the sum of a column for every group.
HasRowData Returns True when a row item is stored for the row.
HideColumn Hides a column; its width is kept and restored by UnhideColumn.
HideRow Hides a row; its height is kept and restored by UnhideRow.
HilightCells Wraps occurrences of a text in highlight markup in the cells covered by the options.
InitSample Clears the grid, resets the default style and loads built-in sample data in four columns.
InsertColumn Inserts an empty column at the specified index, shifting the following columns to the right.
InsertColumns Inserts empty columns at the specified index, shifting the following columns to the right.
InsertRow Inserts an empty row at the specified index, shifting the following rows down.
InsertRows Inserts empty rows at the specified index, shifting the following rows down.
IsCellBase Returns True when the cell is its own base cell.
IsCellDisabled Returns True when the cell cannot be interacted with as a normal data cell.
IsCellDisplayed Returns True when the cell is part of the displayed data view.
IsCellFixed Returns True when the cell lies in a fixed row (top or bottom) or a fixed column (left or right).
IsCellFixedRoot Returns True when the cell lies in one of the corner areas where fixed columns and fixed rows intersect.
IsCellFreeze Returns True when the cell lies in a freeze row or freeze column.
IsCellFreezeFixed Returns True when the cell lies where a freeze band crosses a fixed band.
IsCellFreezeRoot Returns True when the cell lies where the freeze columns and freeze rows intersect.
IsCellHidden Returns True when the cell is not part of the displayed data view.
IsCellMerged Returns True when the cell is covered by a merged range, including its base cell.
IsCellSelected Returns True when the cell is part of the current selection.
IsCellValid Returns True when the cell coordinate lies inside the grid bounds.
IsCellVisible Returns True when the cell is currently on screen.
IsColumnDisplayed Returns True when the column is part of the displayed data view.
IsColumnHidden Returns True when the column is hidden.
IsColumnMerged Returns True when the column is flagged as merged.
IsColumnValid Returns True when the column index lies inside the grid bounds.
IsColumnVisible Returns True when the column is displayed and currently on screen.
IsEditing Returns True while an in-place editor is open.
IsFixedCellSelected Returns True when a fixed cell should be drawn as selected because its row or column is part of the selection.
IsGrouped Returns True when grouping is currently applied.
IsRowBand Returns True when the row is rendered with the band layout.
IsRowDisplayed Returns True when the row is part of the displayed data view.
IsRowFilter Returns True when the row type is grtFilter, the row hosting the filter editors.
IsRowFiltered Returns True when the row is filtered out.
IsRowHidden Returns True when the row is not shown, either because it was hidden or because it is filtered out.
IsRowMerged Returns True when the row is flagged as merged.
IsRowNode Returns True when the row type is grtNode, a collapsible node row (for example a group header).
IsRowNormal Returns True when the row is a regular data row.
IsRowSummary Returns True when the row type is grtSummary, a summary row inserted by grouping or calculations.
IsRowValid Returns True when the row index lies inside the grid bounds.
IsRowVisible Returns True when the row is not hidden (by filtering, node collapsing or an explicit hide).
LastPage Scrolls to the last page.
LinearFill Fills cells with their own coordinates as text ('column:row'), which is useful for testing layouts.
LoadFromCSVData Loads cell data from a CSV file using the system default (ANSI) encoding.
LoadFromCSVStreamData Loads cell data from a stream containing CSV text, using the system default (ANSI) encoding.
LoadFromFileData Loads cell data from a file in the grid's own text format, as written by SaveToFileData, using the system default encoding.
LoadFromFileStreamData Loads cell data in the grid's own text format from a stream, using the system default encoding.
LoadFromJSONData Loads cell data from a JSON file using the specified encoding.
LoadFromJSONStreamData Loads cell data from a stream containing JSON, using the specified encoding.
LoadFromJSONTextData Loads data from a JSON string.
LoadFromXMLData Loads data from an XML file using the default encoding.
LoadFromXMLStreamData Loads data from an XML stream using the default encoding.
LoadSampleData Fills the grid with built-in demo data.
LogMessage Raises the grid log-message event with the specified text and severity.
LoopThroughColumns Executes a callback for each column, optionally including fixed columns.
LoopThroughRows Executes a callback for each row, optionally including fixed rows.
MarkCells Marks cells whose text matches AHilightText for persistent flagging independent of visual highlighting.
MatchFilter Evaluates the current filter against a row without changing its filtered state.
MergeCells Merges a rectangular block of cells into a single display cell.
MergeColumn Vertically merges all data cells in the specified column into a single display cell.
MergeColumns Vertically merges all data cells in ACount consecutive columns starting at AColumn.
MergeRange Merges all cells within the given coordinate range.
MergeRow Horizontally merges all data cells in the specified row into a single display cell.
MergeRows Horizontally merges all data cells in ACount consecutive rows starting at ARow.
MoveColumn Reorders a column by moving it from AFromColumn to AToColumn.
MoveRow Reorders a row by moving it from AFromRow to AToRow.
NextPage Scrolls to the next page by incrementing PageIndex; nothing changes on the last page.
NextSelectableColumn Returns the next selectable cell to the right of a cell, as used by keyboard navigation.
NextSelectableRow Returns the next selectable cell below a cell, as used by keyboard navigation.
NextVisibleColumn Returns the next displayed cell to the right of a cell, skipping hidden columns and merged spans.
NextVisibleRow Returns the next displayed cell below a cell, skipping hidden or filtered rows and merged spans.
PasteFromClipboard Pastes tab-delimited text from the clipboard starting at the focused cell.
PreviousPage Scrolls to the previous page by decrementing PageIndex; nothing changes on the first page.
PreviousSelectableColumn Returns the previous selectable cell to the left of a cell, as used by keyboard navigation.
PreviousSelectableRow Returns the previous selectable cell above a cell, as used by keyboard navigation.
PreviousVisibleColumn Returns the previous displayed cell to the left of a cell, skipping hidden columns and merged spans.
PreviousVisibleRow Returns the previous displayed cell above a cell, skipping hidden or filtered rows and merged spans.
RandomFill Fills all data cells (and optionally fixed cells) with random integer values.
RealToDisplayCell Converts a physical (storage) cell coordinate to the display coordinate.
RealToDisplayColumn Converts a physical (storage) column index to its display index.
RealToDisplayRow Converts a physical (storage) row index to its display index.
RealToVisualColumn Converts a physical (storage) column index to its position among the columns actually rendered (display order applied, hidden columns skipped).
RealToVisualRow Converts a physical (storage) row index to its position among the rows actually rendered (display order applied, hidden and filtered rows skipped).
RemoveBitmap Removes the bitmap cell type from the specified cell, reverting it to a plain text cell.
RemoveButton Removes the button cell type from the specified cell, reverting it to a plain text cell.
RemoveCheckBox Removes the checkbox cell type from the specified cell, reverting it to a plain text cell.
RemoveDataCheckBox Removes the data-bound checkbox control from the specified cell coordinate.
RemoveDataRadioButton Removes the data-bound radio button control from the specified cell coordinate.
RemoveFilter Clears all filter rules and makes all rows visible again.
RemoveFilterEditor Removes the inline filter editor from the specified fixed-row cell.
RemoveGrid Removes the nested sub-grid renderer from the specified cell, reverting it to a plain cell.
RemoveLayout Removes the custom layout assigned to the specified cell coordinate.
RemoveNodeRow Removes the node structure from a row, making it a plain data row again.
RemoveProgressBar Removes the progress bar cell type from the specified cell, reverting it to a plain text cell.
RemoveRadioButton Removes the radio button cell type from the specified cell, reverting it to a plain text cell.
Replace Replaces text in all data cells using default find parameters.
ResetDrag Resets the current drag operation and clears drag state.
RowAverage Returns the average of the numeric values in a row.
RowCalculation Runs a built-in aggregate calculation across a row and stores the result in associated summary columns.
RowCustomCalculation Computes a custom aggregate for a row.
RowDistinct Returns the number of distinct text values in a row.
RowMax Returns the largest numeric value in a row.
RowMin Returns the smallest numeric value in a row.
RowSpan Returns the number of rows spanned by the merged range a cell belongs to.
RowStandardDeviation Returns the standard deviation of the numeric values in a row.
RowSum Returns the sum of the numeric values in a row.
SaveToCSVData Saves cell data to a CSV file using the default encoding.
SaveToCSVStreamData Saves cell data to a CSV stream using the default encoding.
SaveToFileData Saves cell data to the native grid file format using the default encoding.
SaveToFileStreamData Saves cell data to the native grid file format into a stream using the default encoding.
SaveToHTMLData Exports the visible grid content as an HTML table to a file using the default encoding.
SaveToHTMLStreamData Exports the visible grid content as an HTML table into a stream using the default encoding.
SaveToImageData Renders the grid to a PNG image file.
SaveToImageStreamData Renders the grid to a PNG image written to a stream.
Scroll Programmatically scrolls the grid to the given pixel position.
SelectAllCells Selects all data cells in the grid.
SelectCell Selects the specified cell, optionally applying Shift or Ctrl multi-selection semantics.
SelectCellRange Selects a rectangular range of cells defined by column and row indices.
SelectColumns Selects all cells in the specified column range.
SelectRows Selects all cells in the specified row range.
SetBitmap Replaces the existing cell content with a bitmap cell using a TTMSFNCBitmap instance.
SetBitmapColumn Replaces every data row cell in the column with a bitmap cell using a TTMSFNCBitmap.
SetButton Replaces the existing cell content with a button cell having the given caption.
SetButtonColumn Replaces every data row cell in the column with a button cell.
SetCheckBox Replaces the existing cell content with a checkbox cell having the given initial state.
SetCheckBoxColumn Replaces every data row cell in the column with a checkbox cell.
SetGrid Makes a cell host a nested sub-grid renderer and returns it.
SetNodeRow Replaces an existing row with a collapsible tree node row; same behaviour as AddNodeRow but works on an existing row.
SetProgressBar Replaces the existing cell content with a progress bar cell having the given initial value.
SetProgressBarColumn Replaces every data row cell in the column with a progress bar cell.
SetRadioButton Replaces the existing cell content with a radio button cell having the given state and group index.
SetRadioButtonColumn Replaces every data row cell in the column with a radio button cell.
ShowColumnsEditor Opens the column visibility and order editor dialog.
ShowConditionalFormattingEditor Opens the conditional formatting rule editor modally for this grid and applies the edited rules when the user confirms.
ShowFilterDialog Opens the advanced filter dialog for configuring filter rules.
ShowFindDialog Opens the find dialog for searching cell text.
ShowReplaceDialog Opens the find-and-replace dialog.
Sort Sorts all data rows by the specified column and direction.
SortIndexed Re-applies the last sort using the previously computed sort index list.
SplitCell Removes the merge from a merged cell, restoring the individual cells within the formerly merged area.
StopEditing Closes the active in-place editor, writes its value back to the cell and returns focus to the grid.
StretchColumns Stretches columns according to the requested mode, range, and optional target width.
StretchRows Stretches rows according to the requested mode, range, and optional target height.
SwapCells Exchanges the content of two cells.
SwapColumns Exchanges the position of two columns, swapping all their cell data.
SwapRows Exchanges the position of two rows, swapping all their cell data.
ToggleNode Toggles the expand/collapse state of the specified node row.
TypeOfValue Returns the runtime type kind of a cell value.
Ungroup Removes all grouping and returns the grid to a flat, ungrouped view.
UnhideAll Unhides all hidden rows and columns.
UnhideAllColumns Unhides all hidden columns.
UnhideAllRows Unhides all hidden rows.
UnhideColumn Unhides the specified column.
UnhideRow Unhides the specified row.
UnhilightCells Removes visual highlights previously applied by HilightCells.
UnmarkCells Removes persistent cell marks previously applied by MarkCells.
UpdateCalculations Re-runs all column and row calculations and refreshes summary rows.
UpdateColumnCalculation Re-runs a single named column calculation identified by AName for the specified column.
UpdateColumnCalculations Re-runs all named column calculations.
UpdateRowCalculation Re-runs a single named row calculation identified by AName for the specified row.
UpdateRowCalculations Re-runs all named row calculations.
ValueIsEmpty Returns True when a cell value holds no value.
ValueIsFloat Returns True when a cell value is stored as a floating-point type.
ValueIsInteger Returns True when a cell value is stored as an integer type.
ValueIsString Returns True when a cell value is stored as a string type.
ValueToBoolean Converts a cell value to a Boolean without raising an exception.
ValueToFloat Converts a cell value to a Double without raising an exception.
ValueToInt64 Converts a cell value to an Int64 without raising an exception.
ValueToInteger Converts a cell value to an Integer without raising an exception.
ValueToString Converts a cell value to a string without raising an exception.
VisualToRealColumn Converts a position among the rendered columns (display order applied, hidden columns skipped) back to the physical (storage) column index.
VisualToRealRow Converts a position among the rendered rows (display order applied, hidden and filtered rows skipped) back to the physical (storage) row index.
XYToCell Returns the cell under a point.
XYToColumn Returns the column of the cell under a point.
XYToFooter Returns True when a point lies inside the footer area (Footer).
XYToHeader Returns True when a point lies inside the header area (Header).
XYToHeaderGroup Returns the visual grouping chip under a point.
XYToRenderer Returns the nested sub-grid renderer under a point.
XYToRow Returns the row of the cell under a point.