Xceed Grid for WinForms v4.3 Documentation
Setting Up Default Error Messages
Welcome to Xceed Grid for WinForms v4.3 > Basic Concepts > Input Validator control > Setting Up Validation Expressions Visually > Defining Error Messages > Setting Up Default Error Messages

The text used for default error messages can be specified by choosing "Set Up Error Messages" in the ValidationProvider's context menu or by clicking on the appropriate link in the Properties window of the Visual Studio designer. Doing this opens the "Default Validation Error Messages for ValidationProvider" dialog (see image below), in which the default error messages can be edited. When a message is modified, the text appears in bold to indicate that it is no longer the original message.

The Import and Export links in the upper right hand corner of the dialog allow messages to be imported and exported in XML format.

Special String Substitutions

Although some error messages available in this dialog represent the entire message for a given type of validation error (such as "Field is required" for a required field error), most error messages are built up using "special string substitutions". The base message for most error messages is "Should %operator%". The %operator% string represents the error message text associated with the operator used to validate an input component's value. When an error message is displayed, %operator% is replaced by this text. The texts for operators are defined under the "Operators" tab, and the texts for data types under the "Data Type" tab. (See figures below.)

 

 

If you fail to use the special string substitutions, your message may be incomplete. For a complete list of special string substitutions, see Special String Substitutions For Validation Messages.

Resetting Default Messages to Their Original Value

Clicking on the "Reset" button next to an error message text field will reset that message to its original value. For example, if you changed the value of the first field to the rather wordy "This particular Windows Forms list box control should %operator%", you could get back the original value of "Should %operator%" by clicking on the "Reset" button.

Custom Validation Error Messages

Custom validation error messages can be specified by overriding the default messages of individual input components. See Customizing Error Messages for details.