Overview
TCustomTeeGrid is the abstract base class for all TeeGrid implementations. It provides the core architecture, data management, and rendering framework that is shared between VCL and FireMonkey versions of TTeeGrid.Architecture
TCustomTeeGrid serves as the foundation for the grid component hierarchy:Core Properties
Data Management
The virtual data source providing content to the grid. This can be any descendant of TVirtualData including database sources, arrays, lists, or custom data providers.
Reference to a component that provides data, typically a TDataSource for database connectivity.
The main row group that contains all grid data. This is the top-level group in master-detail hierarchies.
The currently focused row group. In a simple grid, this is the same as Root. In master-detail grids, this represents the active detail level.
Visual Structure
Defines the rendering properties for grid cells including font, colors, alignment, and padding.
The collection of columns defining the grid structure. Each column specifies how data is displayed and edited.
Row configuration including default height, alternating row colors, and row selection behavior.
The main column header band configuration.
Collection of additional header bands displayed above the grid.
Collection of footer bands displayed below the grid.
Configuration for the row indicator column showing current row and edit state.
Margins around the grid content area.
Editing
Comprehensive editing configuration including:
Active- Whether an editor is currently visibleAlwaysVisible- Keep editor always visibleAutoEdit- Start editing on keypressDoubleClick- Require double-click to editEnterKey- Behavior when Enter is pressed (NextCell, NextRow, SameCell)EditorClass- Custom editor class
Global read-only flag. When True, all cells are non-editable regardless of column settings.
Selection
Current selection in the grid including:
- Selected cell coordinates
- Selected rows
- Selected range
Public Methods
Display and Rendering
Renders the grid content. Override this method in derived classes to customize rendering.Signature:
Returns the available width for grid content, excluding scrollbars and margins.Signature:Returns: Available width in pixels
Returns the available height for grid content, excluding scrollbars and margins.Signature:Returns: Available height in pixels
Data Operations
Refreshes the grid display from the data source. Call this when the underlying data has changed.Signature:
Determines if a row can be expanded to show detail data.Signature:Parameters:
Sender- The render object requesting expansionARow- Row index to check
Clipboard Operations
Copies the selected cells to the clipboard in tab-delimited format.Signature:Parameters:
ASelection- Optional specific selection to copy (uses current selection if nil)
Pastes clipboard content into the selected cells.Signature:
Utility Methods
Copies all properties from another grid instance.Signature:
Called after the component is loaded from a stream (DFM/FMX file). Override to perform post-load initialization.Signature:
Handles mouse leave events. Call when the mouse cursor leaves the grid area.Signature:
Protected Methods
These methods are available for descendant classes and advanced customization.
Editor Management
Initiates cell editing for the specified column and row.Signature:Parameters:
AColumn- Column to editARow- Row index to editAutoEdit- Optional initial text for auto-edit mode
Stops cell editing and commits changes.Signature:
Cancels cell editing without committing changes.Signature:
Scrolling
Called when horizontal scroll position changes.Signature:
Called when vertical scroll position changes.Signature:
Validates and adjusts scroll positions to stay within valid bounds.Signature:
Data Events
Called when the data source changes or is refreshed.Signature:
Input Handling
Processes keyboard input.Signature:
Processes mouse input.Signature:
Events
Fired after the grid is painted. Use for custom post-rendering operations.
Fired when the selection changes.
Example: Custom Grid Implementation
See Also
TTeeGrid
Main grid component for VCL and FMX
TVirtualData
Abstract data interface
