ComponentOne True DataControl 8.0
Fields Page

The Fields page is used to maintain the Fields collection, which is the most important of True DataControl’s collections. Use the Fields property to access the Fields collection in code.

True DataControl fields are variables storing values dependent on the particular record on which the TData control is positioned. These fields form the TData Recordset. They are exposed to data-aware controls bound to the TData control. See the detailed description in True DataControl Fields.

If you use the TData control in data source mode, the Fields collection is automatically populated when you first open the Fields page after setting the data source properties. However, if you change data source properties later, the existing fields are preserved. To re-populate the Fields collection from the new data source, click the Retrieve Fields button on the Fields page. Alternatively, you can right-click the TData control on the form and choose Retrieve Fields from the control's context menu.

In memory array and user events modes, the Fields collection is initially empty.

To create a new field, click the New button and select New Field from the button's context menu. Alternatively, you can right-click the Fields list and choose New Field from the list's context menu. To remove a field from the list, select it and click the Delete button, or right-click it and choose Delete from the context menu.

You can change the order of the fields by dragging individual items within the Fields list.

When you select an item in the Fields list, the other controls on the page display the properties of the selected field. The topmost controls are three option buttons representing the three kinds of fields supported by True DataControl:

 

Data

Data field values are stored directly in the underlying data source. In data source mode, a data field corresponds to a field in the SourceRecordset. Data fields can also reside in memory (in memory array mode) or be supplied by code (in user events mode).

Calculated

Calculated field values are not stored in a database. They are evaluated at run time based upon the CalculatedExpression property. You can also supply values in code using the CalcFields event.

Linked

Linked fields are used to specify a one-to-one relationship between the field in a master TData control and the field of a dependent TData control.

 

The controls below the option buttons define the properties of the selected field. Depending upon the kind of field, selected DataMode and other settings; some of these controls may not be available.

Name

Specifies the name of the field.

DataSourceField

Specifies the name of the SourceRecordset field from which this True DataControl field is derived. It only has sense for data fields in data source mode. For a linked field, the Linked Field combo box appears instead of Data Source Field.

LinkedField

For a linked field, determines (together with LinkedControl) the name of a field in the LinkedControl (a dependent TData control), to which the field is linked. The Linked Field combo box (appearing only for linked fields, instead of DataSource Field) contains all possible fields in dependents to which a linked field can be linked. The items contain both control name and field name, dot-separated. You must select one of the available items.

DisplayName

Specifies a user-friendly name, under which the field appears in the Find Dialog.

Visible

Determines whether the field is exposed to data-aware controls.

ReadOnly

Determines whether the field can be modified by the end-user.

Searchable

Determines whether the field is included in the Find Dialog.

MaxLength

For string fields only, this setting specifies the maximum number of characters the field can contain.

ModificationMode

Determines how the TData control reacts to changes in the field’s value caused by end-user interaction.

CalculatedExpression

Specifies the expression used to calculate the field's value for calculated fields, and sometimes for data fields.

CalcConditionExpression

Represented by the Condition edit box beside Calculated Expression. Specifies a Boolean expression that determines whether the associated calculated expression should be evaluated.

DefaultExpression

Specifies the default value to be assigned to this field in a newly added record.

QueryMode

Specifies whether the field should appear only in query mode, only in result mode, or in both modes.

QueryOperation

Specifies the comparison operation used with the field generating the query filter condition in query mode.

In addition to these field properties, you can define one or more range conditions and constraints for each field. For more information, see Field Range Conditions and Field Constraints. To do this, click the New button and select New Range Condition or New Constraint from the button's context menu. Alternatively, you can right-click the Fields list and choose either command from the list's context menu. To remove a range condition or a constraint from the list, select it and click the Delete button, or right-click it and choose Delete from the context menu.

Note: Range conditions are unavailable in True DataControl Lite.

Each range condition and each constraint is represented as a child node of the associated field within the Fields list. When you select one of these child nodes, the field property controls described earlier are replaced with controls representing either the range condition or constraint properties, depending upon the selection.

If multiple range conditions are defined, they work as if they were connected by a logical AND operator. The same holds true for field-level constraints.

For range conditions, the following controls are displayed. See Field Range Conditions for details.

ComparisonOperation

Specifies the type of comparison. Allowable values are <, <=, <>, =, >=, >, and also starts with and contains (string fields only). The default value is = (equals).

SkipIfEmpty

Specifies how to handle the range condition when a variable contained within the ValueExpression is empty.

ValueExpression

Specifies the operand to be used for comparison. The resulting range condition is the field op value, where field is the data field that owns this range condition, op is the selected comparison operator, and value is the result of this expression.

ConditionExpression

Represented by the Condition edit box beside Value Expression. Specifies an optional Boolean expression controlling the applicability of this range condition. If this expression is not empty and evaluates to False, the entire range condition will be ignored.

For constraints, the following controls are displayed. See Field Constraints for details.

ConstraintExpression

Specifies a Boolean expression that determines validity of field modification.

ConditionExpression

Represented by the Condition edit box beside Constraint Expression. Specifies an optional Boolean expression controlling the applicability of the constraint. If this expression is not empty and evaluates to False, the entire constraint will be ignored.

MessageExpression

Specifies a string expression that determines the error message to be displayed when a constraint violation occurs.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback