Skip to main content

Overview

Dataset binding in TeeGrid provides powerful features for working with database data, including live updates, sorting, filtering, and custom rendering.

Basic Dataset Binding

The simplest way to connect TeeGrid to a dataset:

Sortable Datasets

ClientDataSet Sorting

FireDAC Dataset Sorting

Switching Between Datasets

From the demo (Unit_Dataset.pas):

Custom Column Rendering

Password Field Example

Working with Large Datasets

TeeGrid uses virtual rendering, so it handles large datasets efficiently. Only visible rows are rendered.

Scrolling Modes

Row Height Options

Complete Example

Features

  • Live Data Binding: Changes in dataset reflect immediately
  • Column Sorting: Click headers to sort (ClientDataSet and FireDAC)
  • Custom Rendering: Override how fields are displayed
  • Multiple Dataset Types: Works with any TDataSet descendant
  • Performance: Virtual rendering handles thousands of records
  • Navigation: Integrates with DBNavigator and dataset methods

Supported Dataset Types

Best Practices

  1. Always clean up sorting indexes in FormDestroy
  2. Use DisableControls when adding many records
  3. Set Automatic row height for multi-line fields
  4. Enable scrolling mode for touch-friendly UI
  5. Use custom rendering for sensitive fields (passwords, etc.)

Next Steps