XlDataValidation.ErrorStyle Property
Gets or sets the style or the alert dialog window used to show the error message.
Namespace: DevExpress.Export.Xl
Assembly: DevExpress.Printing.v24.1.Core.dll
NuGet Package: DevExpress.Printing.Core
Declaration
Property Value
Type | Description |
---|---|
XlDataValidationErrorStyle | One of the XlDataValidationErrorStyle enumeration values representing the alert dialog style. |
Available values:
Name | Description |
---|---|
Stop | The dialog displays the Stop icon; the only options are Retry or Cancel; end-users are not allowed to enter invalid data in the cell. |
Warning | The dialog displays the Warning icon; the end-user can decide whether to allow entry of the invalid data, to retry, or to remove the invalid entry. |
Information | The dialog displays the Information icon; the end-user can click OK to accept the invalid value or Cancel to reject it. |
Remarks
Set the XlDataValidation.ShowErrorMessage property to true to show the error message. Use the XlDataValidation.ErrorMessage property to specify the message to display in the dialog. The XlDataValidation.ErrorTitle property specifies the caption 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;