RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TField.FieldKind Property

Indicates whether a field represents a column in a dataset, a calculated field, or a lookup field.

Pascal
property FieldKind: TFieldKind;
C++
__property TFieldKind FieldKind;

Use FieldKind to determine if a field is a data field, a calculated field, a lookup field, or an aggregate field. The value of FieldKind can be changed programmatically, but in practice FieldKind is set at design time when creating Field components with the Fields editor.

Note: Fields calculated by SQL servers or the Borland Database Engine to display the results of a query that returns a live dataset
have a FieldKind of fkInternalCalc, not fkCalculated. This is because the field values are stored in the dataset. Calculated fields in a client dataset that are calculated in an OnCalcFields event handler but stored in the dataset also have a FieldKind of fkInternalCalc instead of fkCalculated. Unlike regular calculated fields, internally calculated fields can be used in filter expressions. They can be edited, but the changes are discarded. To prevent editing, set the ReadOnly property to true.
Note: The FieldKind property of a field is only stored with the field object if the value is fkInternalCalc.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!