Skip to main content
Bands are rectangular regions in TeeGrid that can display custom content. They’re commonly used for headers, footers, and custom informational sections.

Understanding Bands

A band is a TGridBand object - a rectangle with support for:
  • Mouse hover highlighting
  • Custom height
  • Click events
  • Custom rendering
TeeGrid uses bands for:
  • Headers - Column headers and grid titles
  • Footers - Totals and summary information
  • Rows - The data rows themselves

Band Properties

All bands share these properties:

Headers Collection

Add multiple header bands:
Add multiple footer bands:

AddText Helper Method

Quickly add text bands:

TTextBand

TTextBand is a band that displays text:

Column Header Band

The main header showing column names is a special TColumnHeaderBand:

Custom Band Classes

Create a custom band by inheriting from TGridBand:

Band Events

OnClick

Handle band clicks:

Floating Bands

Make bands float over content:

Band Height Modes

Fixed Height

Percentage Height

Auto Height

For text bands, height can auto-calculate based on text:

Multiple Headers Example

Create a grid with title and column headers:
Add calculated totals in footer:

Bands in Sub-Grids

Each TRowGroup has its own headers and footers:

Band Spacing

Hiding/Showing Bands

Band Lines

Add borders to bands:

Best Practices

  • Use AddText() for simple text headers/footers
  • Keep band heights reasonable (20-40 pixels for text)
  • Use percentage heights sparingly, as they change with window size
  • Group related information in separate bands
  • Use consistent colors for visual hierarchy
  • Consider Floating := True for overlay effects
  • Remember that each sub-grid has its own header/footer collections
  • Use custom band classes for complex rendering needs