Class ExcelDataValidation
- Namespace
- OfficeOpenXml.DataValidation
- Assembly
- EPPlus.dll
Abstract base class for all Excel datavalidations. Contains functionlity which is common for all these different validation types.
public abstract class ExcelDataValidation : IExcelDataValidation
- Inheritance
-
ExcelDataValidation
- Implements
- Derived
- Inherited Members
Constructors
ExcelDataValidation(ExcelDataValidation, ExcelWorksheet)
Copy-Constructor
protected ExcelDataValidation(ExcelDataValidation validation, ExcelWorksheet ws)
Parameters
validation
ExcelDataValidationValidation to copy from
ws
ExcelWorksheetThe worksheet
ExcelDataValidation(string, string, ExcelWorksheet)
Constructor
protected ExcelDataValidation(string uid, string address, ExcelWorksheet ws)
Parameters
uid
stringId for validation
address
stringadress validation is applied to
ws
ExcelWorksheetThe worksheet
ExcelDataValidation(XmlReader, ExcelWorksheet)
Read-File Constructor
protected ExcelDataValidation(XmlReader xr, ExcelWorksheet ws)
Parameters
xr
XmlReaderws
ExcelWorksheetThe worksheet
Properties
Address
Address of data validation
public ExcelAddress Address { get; }
Property Value
AllowBlank
True if blanks should be allowed
public bool? AllowBlank { get; set; }
Property Value
- bool?
AllowsOperator
True if the current validation type allows operator.
public virtual bool AllowsOperator { get; }
Property Value
As
Us this property to case IExcelDataValidations to its subtypes
public ExcelDataValidationAsType As { get; }
Property Value
Error
Error message box text
public string Error { get; set; }
Property Value
ErrorStyle
Warning style
public ExcelDataValidationWarningStyle ErrorStyle { get; set; }
Property Value
ErrorTitle
Title of error message box
public string ErrorTitle { get; set; }
Property Value
ImeMode
Mode for east-asian languages who use Input Method Editors(IME)
public ExcelDataValidationImeMode ImeMode { get; set; }
Property Value
IsStale
Indicates whether this instance is stale, see https://github.com/EPPlusSoftware/EPPlus/wiki/Data-validation-Exceptions DEPRECATED as of Epplus 6.2. This as validations can no longer be stale since all attributes are now always fresh and held in the system.
[Obsolete]
public bool IsStale { get; }
Property Value
OnFormulaChanged
Event method for changing internal type when referring to an external worksheet.
protected Action<OnFormulaChangedEventArgs> OnFormulaChanged { get; }
Property Value
Operator
Operator for comparison between the entered value and Formula/Formulas.
public ExcelDataValidationOperator Operator { get; set; }
Property Value
Prompt
Text of the validation message box.
public string Prompt { get; set; }
Property Value
PromptTitle
Title of the validation message box.
public string PromptTitle { get; set; }
Property Value
ShowErrorMessage
True if error message should be shown
public bool? ShowErrorMessage { get; set; }
Property Value
- bool?
ShowInputMessage
True if input message should be shown
public bool? ShowInputMessage { get; set; }
Property Value
- bool?
Uid
Uid of the data validation
public string Uid { get; }
Property Value
ValidationType
Validation type
public virtual ExcelDataValidationType ValidationType { get; }
Property Value
Methods
Validate()
This method will validate the state of the validation
public virtual void Validate()
Exceptions
- InvalidOperationException
If the state breaks the rules of the validation