Skip to main content

Overview

TeeGrid for VCL provides native Windows grid components for Win32 and Win64 applications. The VCL implementation uses the Visual Component Library framework, delivering high-performance grids with native Windows look and feel.
VCL TeeGrid is implemented in the VCLTee.Grid unit and supports both RAD Studio/Delphi and Lazarus/FreePascal.

Installation

RAD Studio / Delphi

Add the VCL units to your project’s uses clause:

Lazarus / FreePascal

TeeGrid supports Lazarus through the same VCLTee.Grid unit with FPC-specific conditional compilation:

Platform Support

VCL TeeGrid is available for:
  • Windows: Win32 and Win64 platforms
  • Lazarus: Windows, Linux, and other FreePascal-supported platforms

Architecture

The VCL implementation consists of two main classes:

TVCLTeeGrid

Internal grid engine that handles core functionality:
VCLTee.Grid.pas:39
Key responsibilities:
  • Cell editing with VCL controls
  • Scrolling and viewport management
  • Data change notifications
  • Clipboard operations (Copy/Paste)

TTeeGrid

Public component that developers use:
VCLTee.Grid.pas:93
Published properties:
  • Columns - Column definitions
  • DataSource - Data binding
  • Editing - Cell editing settings
  • Selected - Selection appearance and behavior
  • Standard VCL properties (Align, Anchors, etc.)

Rendering

VCL Painter

VCL uses Windows GDI/GDI+ for rendering through the TGDIPainter class:
Features:
  • Anti-aliased text and graphics
  • Gradient fills and transparency
  • High-quality image scaling

Custom Painting

The grid paints using a device context (HDC):
VCLTee.Grid.pas:211
VCL TeeGrid is double-buffered by default to eliminate flicker. Set DoubleBuffered := True in the published properties.

Cell Editing

VCL Editor Controls

VCL TeeGrid supports native VCL editor controls:

Editor Events

VCL-specific event signatures:

Database Integration

DataSource Binding

Connect to TDataSource or TDataSet directly:

Database Example

Unit_DataSource.pas

Themes and Styling

VCL Theme Support

VCL TeeGrid integrates with VCL Styles (Windows themes):

Standard TeeGrid Themes

Scrolling

VCL ScrollBars

VCL TeeGrid uses native Windows scrollbars:

Mouse and Keyboard

VCL Input Handling

VCL-specific mouse and keyboard handling:

Clipboard Operations

Copy and Paste

VCL-specific clipboard integration:

Design-Time Support

Visual Editor

Launch the visual TeeGrid editor at design-time or runtime:

Platform-Specific Features

Windows Messages

VCL TeeGrid responds to Windows messages:
VCLTee.Grid.pas:121

Component Palette

VCL TeeGrid appears in the component palette and can be dropped onto forms at design-time.

Performance Tips

This improves scrolling performance with large datasets by keeping the selected row in view.
Reduces CPU usage by ignoring mouse move events.

Lazarus-Specific Notes

FreePascal Compatibility

The VCL implementation includes FPC-specific code paths:

Lazarus Database Example

Common Patterns

See Also

FireMonkey Framework

Cross-platform FMX implementation

Lazarus Framework

FreePascal-specific features

Cell Editing

Editor controls and customization

Themes

Visual themes and styling