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 |
---|---|---|
ExcelDataValidation | validation | Validation to copy from |
ExcelWorksheet | ws | The worksheet |
ExcelDataValidation(String, String, ExcelWorksheet)
Constructor
Declaration
protected ExcelDataValidation(string uid, string address, ExcelWorksheet ws)
Parameters
Type | Name | Description |
---|---|---|
System.String | uid | Id for validation |
System.String | address | adress validation is applied to |
ExcelWorksheet | ws | The worksheet |
ExcelDataValidation(XmlReader, ExcelWorksheet)
Read-File Constructor
Declaration
protected ExcelDataValidation(XmlReader xr, ExcelWorksheet ws)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | xr | |
ExcelWorksheet | ws | The worksheet |
Properties
Address
Address of data validation
Declaration
public ExcelAddress Address { get; }
Property Value
Type | Description |
---|---|
ExcelAddress |
AllowBlank
True if blanks should be allowed
Declaration
public bool? AllowBlank { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
AllowsOperator
True if the current validation type allows operator.
Declaration
public virtual bool AllowsOperator { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
As
Us this property to case IExcelDataValidations to its subtypes
Declaration
public ExcelDataValidationAsType As { get; }
Property Value
Type | Description |
---|---|
ExcelDataValidationAsType |
Error
Error message box text
Declaration
public string Error { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ErrorStyle
Warning style
Declaration
public ExcelDataValidationWarningStyle ErrorStyle { get; set; }
Property Value
Type | Description |
---|---|
ExcelDataValidationWarningStyle |
ErrorTitle
Title of error message box
Declaration
public string ErrorTitle { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ImeMode
Mode for east-asian languages who use Input Method Editors(IME)
Declaration
public ExcelDataValidationImeMode ImeMode { get; set; }
Property Value
Type | Description |
---|---|
ExcelDataValidationImeMode |
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.Boolean |
OnFormulaChanged
Event method for changing internal type when referring to an external worksheet.
Declaration
protected Action<OnFormulaChangedEventArgs> OnFormulaChanged { get; }
Property Value
Type | Description |
---|---|
System.Action<OnFormulaChangedEventArgs> |
Operator
Operator for comparison between the entered value and Formula/Formulas.
Declaration
public ExcelDataValidationOperator Operator { get; set; }
Property Value
Type | Description |
---|---|
ExcelDataValidationOperator |
Prompt
Text of the validation message box.
Declaration
public string Prompt { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PromptTitle
Title of the validation message box.
Declaration
public string PromptTitle { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ShowErrorMessage
True if error message should be shown
Declaration
public bool? ShowErrorMessage { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
ShowInputMessage
True if input message should be shown
Declaration
public bool? ShowInputMessage { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
Uid
Uid of the data validation
Declaration
public string Uid { get; }
Property Value
Type | Description |
---|---|
System.String |
ValidationType
Validation type
Declaration
public virtual ExcelDataValidationType ValidationType { get; }
Property Value
Type | Description |
---|---|
ExcelDataValidationType |
Methods
Validate()
This method will validate the state of the validation
Declaration
public virtual void Validate()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | If the state breaks the rules of the validation |