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
- Always clean up sorting indexes in FormDestroy
- Use DisableControls when adding many records
- Set Automatic row height for multi-line fields
- Enable scrolling mode for touch-friendly UI
- Use custom rendering for sensitive fields (passwords, etc.)
Next Steps
- Learn about Master-Detail grids
- Explore Database Grid basics
- See Performance tips
