You can use different highlighting styles to identify erroneous information in a cell. Spread for WPF allows you to customize the UI of validation error indicators, which appear when users enter invalid data. In this case, you can use the built-in validation error indicator or design your own style based on your needs. You may also change the appearance of error indications, such as the background color, foreground color, border color, and so on, to personalize the style of the built-in validation error indicator.
To apply the built-in validation error indicators, set a data template in the DataValidationTemplate property of the GcSpreadSheet class. The data type used for the data template is DataValidationContext. After setting this, use the ValidationErrorIndicator class to apply the built-in styles.
The following image displays a validation error with a built-in style applied where a red triangle appears in the top right corner of a cell when contains an incorrect value by default.
Refer to the following example code to use the built-in validation error.
The built-in validation error indicator can also be customized to include formatting for changing the background color, forecolor, border colors, etc. To change the style of the error messages, customize the attributes of the ValidationErrorIndicator class in your data template.
The image below displays the validation error with a built-in style where the background color, foreground color, border color have been changed.
Below is an example that demonstrates how to customize validation error indicators in DataValidationTemplate to display error messages for invalid entries in a worksheet bound to a data source.
If you want complete control over the appearance of the validation error indicator, you can create a custom one. This includes creating your own error messages and even creating your own control to use it as an error indicator.
Refer to the following example code to create a custom control for data validation error messages.