ColDataproperty
Returns or sets an arbitrary long value associated with each column.
Syntax
PROPERTY ColData (BYVAL Index AS LONG) AS LONG
PROPERTY ColData (BYVAL Index AS LONG, BYVAL nData AS LONG)
Parameters
| Name | Description | |
|---|---|---|
Index | The zero-based index of the column. |
Description
Returns or sets an arbitrary long value associated with each column. This property is an array that stores a Long for every column in the grid. It is purely for developer use and is never visible to the end-user.
Remarks
It is most commonly used to store internal identifiers, such as database field types, original source indices, or bit-flags that determine how the column should behave (e.g., "Sortable" vs. "Non-sortable").
If you move a column using the ColPosition property, the ColData value moves with it, ensuring the metadata stays attached to the correct data column.
The value is never rendered on the screen. It is accessible only through code.
Example
' Define constants for custom data types Const TYPE_STRING = 0 Const TYPE_CURRENCY = 1
' Tag Column 2 as a currency column grid.ColData(2) = TYPE_CURRENCY
' Later, check the tag to apply formatting If grid.ColData(grid.Col) = TYPE_CURRENCY Then
Print "This column contains financial data."
End If
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid