ComponentOne True DataControl 8.0
Validation and Constraints

True DataControl allows you to define two kinds of data validation constraints:

  1. Field-level constraints are defined for each field in the field’s Constraints collection. For more information, see Field Constraints. As the name implies, each constraint belongs to an individual field. True DataControl automatically checks field constraints whenever the field value changes. It also checks other validation conditions on field change, see below.

  2. Record-level constraints are defined in the TData control’s Constraints collection. For more information, see Record Validation. These constraints usually involve multiple field values, and are tested when the TData control is repositioned to a different record or when the modified record is posted to the database. True DataControl does not test record-level constraints when a field value changes.

In addition to these programmer-specified constraints, True DataControl automatically performs data format validation upon every field change. For example, True DataControl will reject input such as 31/31/99 for date fields. If a field's Required property is True, empty data values are rejected as well.

If necessary, you can perform your own validation in code by writing a handler for the WillChangeField event. Record-level validation can be performed in code in the WillChangeRecord event.

See Also

 

 


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

Product Support Forum  |  Documentation Feedback