Skip to main content

XlDataValidation.ErrorMessage Property

Gets or sets the error message to display when the entered data is not valid.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v24.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

public string ErrorMessage { get; set; }

Property Value

Type Description
String

A String text for the error message.

Remarks

Set the XlDataValidation.ShowErrorMessage property to true to show the error message. Use the XlDataValidation.ErrorTitle property to specify the dialog caption. The XlDataValidation.ErrorStyle property specifies the type of the alert window.

The code sample below shows how to show the warning message when the entered data in invalid:

// Display the error message.
validation.ErrorMessage = "The salary amount must be between 600$ and 2000$.";
validation.ErrorTitle = "Warning";
validation.ErrorStyle = XlDataValidationErrorStyle.Warning;
validation.ShowErrorMessage = true;
See Also