TRowGroup objects to organize rows. Each grid has a root row group, and you can create sub-groups for hierarchical layouts.
Understanding TRowGroup
ATRowGroup is a band that contains:
- Columns - Column definitions
- Rows - Data rows
- Header - Column header band
- Headers - Additional header bands collection
- Footer - Footer bands collection
- Data - Associated data source
Root Row Group
Access the main grid’s row group:Current Row Group
The focused/active row group:Row Group Properties
Each row group has independent properties:Creating Sub-Groups
Sub-groups are created through master-detail expansion:Row Group Hierarchy
Navigate the group hierarchy:Group-Specific Data
Each group has its own data source:Group-Specific Columns
Detail groups can have different columns:Group Selection
Each group has independent selection:Scrolling in Groups
Each group has independent scrolling:Group Painting
Customize group appearance:Multiple Independent Grids
You can have multiple grids, each with its own root group:Accessing All Groups
Iterate through all row groups:Group Context Menu
Different context menus for different groups:Programmatic Group Creation
Manually create row groups (advanced):Group Events
OnChangedSelected
Fired when selection changes in the group:OnNewDetail
Fired when a detail sub-group is created:Focused Groups
Determine which group has focus:Best Practices
- Use
OnNewDetailto configure detail groups when they’re created - Store references to important groups in form fields if needed
- Use
Currentto determine which group has focus - Apply consistent formatting within group levels
- Each group can have completely different columns and data
- Remember that selection, scrolling, and formatting are per-group
- Use distinct colors for different hierarchy levels
- Clean up expanded groups when not needed to save memory
- Use
OwnsData := Trueso groups manage their data lifecycle
