Skip to main content

Overview

TTeeGrid is the main grid component available for both VCL and FireMonkey (FMX) frameworks. It provides a high-performance, feature-rich interface for displaying and editing tabular data with support for columns, rows, headers, footers, and cell editing.
TTeeGrid is implemented separately for VCL (VCLTee.Grid) and FMX (FMXTee.Grid), but both share the same core properties and methods through the base TCustomTeeGrid class.

Properties

Data and Display

TVirtualData
The data source for the grid. Assign an instance of TVirtualData or its descendants (TDataSource, TArray<T>, TList<T>, etc.) to populate the grid with data.
TColumns
Collection of grid columns that define the structure and appearance of data columns. Each column can have custom formatting, width, alignment, and editor settings.
TRows
Configuration for grid rows including height, alternating colors, and row selection settings.
TComponent
Direct link to a TDataSource component for database connectivity. Alternative to using the Data property.

Visual Elements

TFormat
Background formatting for the grid including color, gradient, stroke, and shadow settings.
TTextRender
Formatting and rendering settings for grid cells including font, alignment, padding, and text appearance.
TColumnHeaderBand
Configuration for the column header band including visibility, height, text formatting, and sorting indicators.
TGridBands
Collection of additional header bands that can be displayed above the grid.
Collection of footer bands that can be displayed below the grid for totals, summaries, or additional information.
TIndicator
Settings for the row indicator column that shows the current row and editing state.

Behavior

Boolean
default:"True"
When True, prevents editing of grid cells. Set to False to allow cell editing.
TGridEditing
Configuration for cell editing behavior including auto-edit mode, double-click editing, and Enter key behavior.
TGridSelection
The currently selected cell, row, or range in the grid. Use this to programmatically control or read the selection.
TGridScrolling
Settings for grid scrolling behavior including scroll mode and smooth scrolling options.
TPainter
The painter implementation used to render the grid. Can be GDI, GDI+, or other custom painters.

Events

Cell Events

TCellEditingEvent
Fired when a cell editor is about to be displayed. Use this event to customize the editor control.Signature:
TCellEditedEvent
Fired when cell editing is complete. Allows validation and modification of the new data before it’s saved.Signature:

Selection Events

TNotifyEvent
Fired when the grid selection changes (cell or row selection).

Column Events

TNotifyEvent
Fired when a column header is clicked, typically used for sorting.
TColumnEvent
Fired after a column has been resized by the user.Signature:

Detail Events

TNewDetailEvent
Fired when a detail (sub-grid) is about to be created for a master-detail relationship.Signature:

Drawing Events

TNotifyEvent
Fired after the grid has been painted. Use for custom drawing operations.

Public Methods

procedure
Copies properties from another TPersistent object.Signature:
procedure
Triggers a repaint of the grid. Call this when you programmatically change grid properties.Signature:
VCL Only
procedure
Triggers a repaint of the grid. Call this when you programmatically change grid properties.Signature:
FMX Only

Example Usage

Basic Grid Setup

Handling Cell Editing

Master-Detail Configuration

Platform Differences

VCL

  • Uses GDI/GDI+ for rendering
  • Property: Canvas - Direct access to TControlCanvas
  • Method: DoChanged - Trigger repaint
  • Built-in scrollbar support via TScrollableControl

FireMonkey

  • Cross-platform rendering
  • Method: Changed - Trigger repaint
  • Touch and gesture support
  • Supports multiple platforms (Windows, macOS, iOS, Android)

See Also

TCustomTeeGrid

Base class with core grid architecture

TVirtualData

Abstract data interface for grid data sources