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
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.
Collection of grid columns that define the structure and appearance of data columns. Each column can have custom formatting, width, alignment, and editor settings.
Configuration for grid rows including height, alternating colors, and row selection settings.
Direct link to a TDataSource component for database connectivity. Alternative to using the Data property.
Visual Elements
Background formatting for the grid including color, gradient, stroke, and shadow settings.
Formatting and rendering settings for grid cells including font, alignment, padding, and text appearance.
Configuration for the column header band including visibility, height, text formatting, and sorting indicators.
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.
Settings for the row indicator column that shows the current row and editing state.
Behavior
When True, prevents editing of grid cells. Set to False to allow cell editing.
Configuration for cell editing behavior including auto-edit mode, double-click editing, and Enter key behavior.
The currently selected cell, row, or range in the grid. Use this to programmatically control or read the selection.
Settings for grid scrolling behavior including scroll mode and smooth scrolling options.
The painter implementation used to render the grid. Can be GDI, GDI+, or other custom painters.
Events
Cell Events
Fired when a cell editor is about to be displayed. Use this event to customize the editor control.Signature:
Fired when cell editing is complete. Allows validation and modification of the new data before it’s saved.Signature:
Selection Events
Fired when the grid selection changes (cell or row selection).
Column Events
Fired when a column header is clicked, typically used for sorting.
Fired after a column has been resized by the user.Signature:
Detail Events
Fired when a detail (sub-grid) is about to be created for a master-detail relationship.Signature:
Drawing Events
Fired after the grid has been painted. Use for custom drawing operations.
Public Methods
Copies properties from another TPersistent object.Signature:
Triggers a repaint of the grid. Call this when you programmatically change grid properties.Signature:VCL Only
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
