Object Reference > True DBGrid Properties > Bands Property |
Bands Property
The Bands property returns the number of levels within a hierarchical recordset.
TDBGrid.Bands
Read-only at run time. Read/Write at design time.
When a grid is bound to a master-detail data source, you can display related groups of hierarchical data using bands. A band is created for each level in a hierarchical recordset, and may consist of entire tables or a just a few selected fields. A band is a virtual representation of a hierarchical recordset; it is not the data itself.
The Bands property is provided for cases where the number of levels in a hierarchical recordset is not known in advance. The following example uses the Bands property and the ExpandBand method to display all available bands:
Dim n As Integer
For n = 0 To TDBGrid1.Bands – 1
TDBGrid1.ExpandBand(n)
Next n
Note
This property is only supported by the OLE DB version of True DBGrid Pro. It is used only in bound mode and has no effect in unbound or storage modes.