Class ExcelDataValidation
Abstract base class for all Excel datavalidations. Contains functionlity which is common for all these different validation types.
Inheritance
Implements
Inherited Members
Namespace: OfficeOpenXml.DataValidation
Assembly: EPPlus.dll
Syntax
public abstract class ExcelDataValidation : IExcelDataValidation
Constructors
ExcelDataValidation(ExcelDataValidation, ExcelWorksheet)
Copy-Constructor
Declaration
protected ExcelDataValidation(ExcelDataValidation validation, ExcelWorksheet ws)
Parameters
Type | Name | Description |
---|---|---|
Excel |
validation | Validation to copy from |
Excel |
ws | The worksheet |
ExcelDataValidation(String, String, ExcelWorksheet)
Constructor
Declaration
protected ExcelDataValidation(string uid, string address, ExcelWorksheet ws)
Parameters
Type | Name | Description |
---|---|---|
System. |
uid | Id for validation |
System. |
address | adress validation is applied to |
Excel |
ws | The worksheet |
ExcelDataValidation(XmlReader, ExcelWorksheet)
Read-File Constructor
Declaration
protected ExcelDataValidation(XmlReader xr, ExcelWorksheet ws)
Parameters
Type | Name | Description |
---|---|---|
System. |
xr | |
Excel |
ws | The worksheet |
Properties
Address
Address of data validation
Declaration
public ExcelAddress Address { get; }
Property Value
Type | Description |
---|---|
Excel |
AllowBlank
True if blanks should be allowed
Declaration
public bool? AllowBlank { get; set; }
Property Value
Type | Description |
---|---|
System. |
AllowsOperator
True if the current validation type allows operator.
Declaration
public virtual bool AllowsOperator { get; }
Property Value
Type | Description |
---|---|
System. |
As
Us this property to case IExcel
Declaration
public ExcelDataValidationAsType As { get; }
Property Value
Type | Description |
---|---|
Excel |
Error
Error message box text
Declaration
public string Error { get; set; }
Property Value
Type | Description |
---|---|
System. |
ErrorStyle
Warning style
Declaration
public ExcelDataValidationWarningStyle ErrorStyle { get; set; }
Property Value
Type | Description |
---|---|
Excel |
ErrorTitle
Title of error message box
Declaration
public string ErrorTitle { get; set; }
Property Value
Type | Description |
---|---|
System. |
ImeMode
Mode for east-asian languages who use Input Method Editors(IME)
Declaration
public ExcelDataValidationImeMode ImeMode { get; set; }
Property Value
Type | Description |
---|---|
Excel |
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.
Declaration
[Obsolete]
public bool IsStale { get; }
Property Value
Type | Description |
---|---|
System. |
OnFormulaChanged
Event method for changing internal type when referring to an external worksheet.
Declaration
protected Action<OnFormulaChangedEventArgs> OnFormulaChanged { get; }
Property Value
Type | Description |
---|---|
System. |
Operator
Operator for comparison between the entered value and Formula/Formulas.
Declaration
public ExcelDataValidationOperator Operator { get; set; }
Property Value
Type | Description |
---|---|
Excel |
Prompt
Text of the validation message box.
Declaration
public string Prompt { get; set; }
Property Value
Type | Description |
---|---|
System. |
PromptTitle
Title of the validation message box.
Declaration
public string PromptTitle { get; set; }
Property Value
Type | Description |
---|---|
System. |
ShowErrorMessage
True if error message should be shown
Declaration
public bool? ShowErrorMessage { get; set; }
Property Value
Type | Description |
---|---|
System. |
ShowInputMessage
True if input message should be shown
Declaration
public bool? ShowInputMessage { get; set; }
Property Value
Type | Description |
---|---|
System. |
Uid
Uid of the data validation
Declaration
public string Uid { get; }
Property Value
Type | Description |
---|---|
System. |
ValidationType
Validation type
Declaration
public virtual ExcelDataValidationType ValidationType { get; }
Property Value
Type | Description |
---|---|
Excel |
Methods
Validate()
This method will validate the state of the validation
Declaration
public virtual void Validate()
Exceptions
Type | Condition |
---|---|
System. |
If the state breaks the rules of the validation |