ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

ValueItems.Validate Property

Gets or sets a value indicating whether values entered by the user must match on of the ValueItem objects.

[Visual Basic]

Public Property Validate As Boolean

[C#]

public bool Validate {get;set;}

[Delphi]

public property Validate: Boolean read get_Validate write set_Validate;

Remarks

If True, the grid automatically validates the user's input when the current cell is changed. If the cell contents do not match the ValueItem.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, the C1TrueDBGrid.BeforeColUpdate event can still be used to validate the user's changes.

The C1TrueDBGrid.BeforeColUpdate event will not be executed for a column if both of the following are true:

·      The associated ValueItems collection contains at least one ValueItem.

·      The Validate property of the ValueItems collection is set to True.

Example

The following code requires that a value entered must match the values in the ValueItemCollection. If no matching value is found the ValueItemError event will be raised:

·      Visual Basic

       Me.C1TrueDBGrid1.Columns("Country").ValueItems.Validate = True

·      C#

       this.c1TrueDBGrid1.Columns["Country"].ValueItems.Validate = true;

·      Delphi

       Self.C1TrueDBGrid1.Columns['Country'].ValueItems.Validate := True;

See Also

ValueItems Class | ValueItems Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.