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

As described in a previous topic, validation error messages appear in a tooltip when the mouse hovers over the error icon displayed next to an input component containing an invalid value. Default messages are provided, but error messages can be fully customized for individual input components. Clicking on the "Customize Error Messages for this Criterion" link in the Validation Configuration dialog displays the "Customize Validation Error Messages for Criterion" dialog. When a message is modified, the text appears in bold to indicate that it is no longer the original message. Clicking the Apply button will set the custom error messages for the criterion currently being configured.

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

Special String Substitutions

Although some of the 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 other 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 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 error messages for operators are defined under the "Operators" tab. The error messages for data types are defined under the "Data Type" tab. 

 

 

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 Error Messages.

Resetting Custom Messages to Default Values

Clicking on the "Reset" button next to one of the text fields will reset it to the corresponding message contained in the "Default Validation Error Messages for ValidationProvider" dialog. 

This means that for a particular input component, you could decide to customize all of its messages by providing new ones in all of the fields. On the other hand, you could decide to customize only one or two messages.

See Also

Special String Substitutions for Validation Error Messages