BandDataproperty
Returns or sets an arbitrary long value associated with each band.
Syntax
PROPERTY BandData (BYVAL band AS LONG) AS LONG
PROPERTY BandData (BYVAL band AS LONG, BYVAL nData AS LONG)
Parameters
| Name | Description | |
|---|---|---|
band | The zero-based index of the band (e.g., 0 for the parent level, 1 for the first child level). |
Description
Returns or sets an arbitrary long value associated with each band. This property is an array that stores a Long for every band in the grid. It is purely for developer use and is never visible to the end-user.
Remarks
It is an "arbitrary" value, meaning it has no inherent effect on the grid's display. It is used programmatically to "tag" bands with information such as a database table ID, a bit-mask for permissions, or a custom state flag.
In complex hierarchical views (Master-Detail-Subdetail), BandData is often used to quickly identify which database entity a specific band represents without having to check the grid's data source or binding string.
Example
' Tag the parent band with a custom code (e.g., 100) grid.BandData(0) = 100
' Tag the first child band with a custom code (e.g., 200) grid.BandData(1) = 200
' Later, check which band the user is currently interacting with If grid.BandData(grid.BandDisplay) = 100 Then
Print "You are in the primary data level."
End If
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid