TBIGrid component displays data in a grid/table format with sorting, filtering, and editing capabilities.
Basic Usage
VCL
VCLBI.Grid.pas:69 for the VCL TBIGrid class.
FireMonkey
FMXBI.Grid.pas:27 for the FMX TBIGrid class.
Grid Engine
TBIGrid uses a pluggable architecture. Set the engine before creating grids:Using DBGrid (Default for VCL)
Using TeeGrid (Optional)
VCLBI.Grid.pas:121 for the Engine class variable.
Grid Features
Row Numbers
Display row numbers in the first column:VCLBI.Grid.pas:51-54 for TRowNumbers.
Filters
Enable column filtering:VCLBI.Grid.pas:56-59 for TGridFilters.
Search
Enable search functionality:VCLBI.Grid.pas:63-66 for TGridSearch.
Read-Only Mode
VCLBI.Grid.pas:139 for the ReadOnly property.
Totals Row
VCLBI.Grid.pas:143 for the Totals property.
Alternate Row Colors
VCLBI.Grid.pas:136 for the Alternate property.
Navigation
Current Row
VCLBI.Grid.pas:132 for the CurrentRow property.
Focus Specific Cell
VCLBI.Grid.pas:129 for the FocusCell method.
Binding
Bind to data sources:VCLBI.Grid.pas:126 for the BindTo method.
Filtering
Apply filters programmatically:VCLBI.Grid.pas:133 for the Filter property.
Colorization
Highlight cells based on values:VCLBI.Grid.pas:127 for the Colorize method.
Duplicate Handling
Hide or highlight duplicate values:VCLBI.Grid.pas:128 for the Duplicates method.
Sub-Items Display
Automatically show related data:VCLBI.Grid.pas:142 for the ShowItems property.
When enabled, clicking a row shows related detail items in a side panel.
Events
Data Change
VCLBI.Grid.pas:145 for OnDataChange.
Update Data
VCLBI.Grid.pas:146 for OnUpdateData.
DataSource Access
Access underlying dataset:VCLBI.Grid.pas:137 for the DataSource property.
Plugin System
The grid uses a plugin architecture for flexibility:VCLBI.Grid.pas:134 for the Plugin property.
Complete Example
VCL vs FireMonkey Differences
Most API is identical, but there are some differences:| Feature | VCL | FireMonkey |
|---|---|---|
| Filters | ✓ Supported | ✗ Not available |
| Search | ✓ Supported | ✗ Not available |
| Row Numbers | ✓ Supported | ✗ Not available |
| Totals | ✓ Supported | ✗ Not available |
| Copy to Clipboard | ✓ Built-in | ✓ Via TUICommon |
VCLBI.Grid.pas:40-60 and FMXBI.Grid.pas:27 for platform differences.
Next Steps
Charts
Visualize data with charts
Trees
Display hierarchical data
