Namespace OfficeOpenXml.DataValidation
Classes
ExcelDataValidation
Abstract base class for all Excel datavalidations. Contains functionlity which is common for all these different validation types.
ExcelDataValidationAny
Any value validation.
ExcelDataValidationAsType
Provides a simple way to type cast a data validation object to its actual class.
ExcelDataValidationCollection
Collection of ExcelDataValidation. This class is providing the API for EPPlus data validation.
The public methods of this class (Add[...]Validation) will create a datavalidation entry in the worksheet. When this validation has been created changes to the properties will affect the workbook immediately.
Each type of validation has either a formula or a typed value/values, except for custom validation which has a formula only.
// Add a date time validation
var validation = worksheet.DataValidation.AddDateTimeValidation("A1");
// set validation properties
validation.ShowErrorMessage = true;
validation.ErrorTitle = "An invalid date was entered";
validation.Error = "The date must be between 2011-01-31 and 2011-12-31";
validation.Prompt = "Enter date here";
validation.Formula.Value = DateTime.Parse("2011-01-01");
validation.Formula2.Value = DateTime.Parse("2011-12-31");
validation.Operator = ExcelDataValidationOperator.between;
ExcelDataValidationCustom
Custom validation, i.e. a formula.
ExcelDataValidationDateTime
Validation for System.DateTime.
ExcelDataValidationDecimal
Data validation for decimal values
ExcelDataValidationExtList
ExcelDataValidationInt
Data validation for integer values.
ExcelDataValidationList
This class represents an List data validation.
ExcelDataValidationTime
Validation for times (ExcelTime).
ExcelDataValidationType
Types of datavalidation
ExcelDataValidationWithFormula<T>
A validation containing a formula
ExcelDataValidationWithFormula2<T>
Represents a data validation with two formulas
ExcelExLstDataValidationCollection
ExcelTime
Represents a time between 00:00:00 and 23:59:59
Interfaces
IRangeDataValidation
Provides functionality for adding datavalidation to a range (ExcelRangeBase). Each method will return a configurable validation.
Enums
eDataValidationType
Enum for available data validation types
ExcelDataValidationOperator
Operator for comparison between Formula and Formula2 in a validation.
ExcelDataValidationWarningStyle
warning style, controls how Excel will handle invalid changes.