ComponentOne True DataControl 8.0
Constraints Page

The Constraints page is used to maintain the Constraints collection. Use the Constraints property to access the Constraints collection in code.

These are record-level constraints. Unlike field-level constraints, record-level constraints impose restrictions on the record as a whole. See more about record-level constraints in Validation and Constraints.

If multiple constraint expressions are defined, they work as if they were connected by a logical AND operator.

The Constraints page is initially empty. Click the New button to create an uninitialized constraint and enable the other controls on the page. Alternatively, you can right-click the Constraints list and choose New from the context menu. To remove a constraint 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 evaluation order of the constraints by dragging individual items within the Constraints list.

When you select an item in the Constraints list, the other controls on the page display the attributes of the selected constraint:

ConstraintExpression

Specifies a Boolean expression that determines the validity of a modified record. If the constraint expression evaluates to False, record modification is not allowed.

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. If you leave this property blank, the TData control displays a generic "Constraint violation" message.

 

 


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

Product Support Forum  |  Documentation Feedback