Back to Devexpress

XlDataValidation.ErrorStyle Property

corelibraries-devexpress-dot-export-dot-xl-dot-xldatavalidation-8056cdc1.md

latest2.9 KB
Original Source

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.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public XlDataValidationErrorStyle ErrorStyle { get; set; }
vb
Public Property ErrorStyle As XlDataValidationErrorStyle

Property Value

TypeDescription
XlDataValidationErrorStyle

One of the XlDataValidationErrorStyle enumeration values representing the alert dialog style.

|

Available values:

NameDescription
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:

csharp
// 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;
vb
' 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

XlDataValidation Class

XlDataValidation Members

DevExpress.Export.Xl Namespace