Object Reference > True DBGrid Properties > DefaultValue Property |
DefaultValue Property
This property returns or sets the default value of an unbound grid column in a bound grid.
column.DefaultValue= variant
Read/Write at run time and design time.
Unbound columns are typically used to display calculated fields or local data not maintained by the primary data source.
This property applies only to unbound columns. The value specified will be preloaded into the last argument passed to the UnboundColumnFetch event.
The DefaultValue property can also be used to identify specific columns in the UnboundColumnFetch event when columns are added, moved, or removed at run time.
For bound columns or columns of an unbound grid, the grid does not use this property itself, but provides it as a placeholder for you to associate default values with the columns. In the UnboundAddData event, you can use this property to retrieve default values for columns that were not supplied by the end user. Such columns will contain a Null variant in the corresponding RowBuffer.Value property array.
This property can also be used as a tag for a column (whether it is bound or unbound). Arbitrary values can be stored and retrieved later
Note
Do not confuse unbound columns with unbound mode. The DefaultValue property has no effect on data displayed in an unbound grid.