Object Reference > True DBGrid Properties > Validate Property |
This property determines whether values entered by the user must match one of the ValueItem objects contained in a column's ValueItems collection.
valueitems.Validate= boolean
Read/Write at run time and design time.
If True, the grid automatically validates the user's input when the current cell is changed. If the cell contents do not match the DisplayValue setting of one of the ValueItem objects, then focus remains on the current cell and its prior contents are restored.
If False (the default), the grid performs no validation. However, you can still use the BeforeColUpdate event to validate the user's changes.
The BeforeColUpdate event will not be executed for a column if both of the following are true:
1. The associated ValueItems collection contains at least one ValueItem.
2. The Validate property of the ValueItems collection is set to True.
Use the ValueItems property to access the ValueItems collection for a Column object.
ValueItem Object, ValueItems Collection