Overview
TheTGridBands class is a collection that manages multiple TGridBand objects. Grid bands are rectangular areas within a TeeGrid that can display headers, footers, totals, or custom content. Each band supports mouse interaction, custom height, and click events.
Class Hierarchy
Properties
Visible
True
Example:
Items
TGridBand objects in the collection.
Parameters:
Index: Zero-based integer index
Floating
Height
Methods
Constructor Create
TGridBands collection.
Parameters:
AOwner: The persistent object that owns this collectionAChanged: Event handler called when the collection changes
Assign
Source: The source object to copy from
AddText
AText: The text to display in the band
TTextBand object
Example:
CalcHeight
APainter: The painter object used for measurement calculationsATotal: The total available height
CanDisplay
True if the band collection can be displayed (is visible and contains items).
Returns: Boolean indicating if bands should be painted
Mouse
AState: The current mouse state (position, button, event type)AWidth: The width of the band areaAHeight: The height of the band area
Paint
AData: Rendering data containing painter and bounds information
Related Classes
TGridBand
Base class for individual bands with the following key properties:- Height:
TBandHeight- The height of the band - OnClick:
TNotifyEvent- Event triggered when the band is clicked - Visible:
Boolean- Controls band visibility - Hover: Inherited hover support for mouse interaction
TTextBand
Specialized band for displaying text, inherits fromTGridBand:
- Text:
String- The text to display - TextRender:
TCellRender- Formatting options for the text
Usage Examples
Creating a Custom Header
Adding Multiple Bands
Handling Band Click Events
Constants
Spacing
See Also
- TGridSelection - Cell selection management
- TGridEditing - Cell editing configuration
- TIndicator - Grid row indicator column
