Interface IRangeDataValidation
Provides functionality for adding datavalidation to a range (ExcelRangeBase). Each method will return a configurable validation.
Namespace: OfficeOpenXml.DataValidation
Assembly: EPPlus.dll
Syntax
public interface IRangeDataValidation
Methods
AddAnyDataValidation()
Adds a IExcelDataValidationAny to the range.
Declaration
IExcelDataValidationAny AddAnyDataValidation()
Returns
Type | Description |
---|---|
IExcelDataValidationAny | A ExcelDataValidationAny that can be configured for any validation |
AddCustomDataValidation()
Adds a IExcelDataValidationCustom to the range.
Declaration
IExcelDataValidationCustom AddCustomDataValidation()
Returns
Type | Description |
---|---|
IExcelDataValidationCustom | A IExcelDataValidationCustom that can be configured for custom validation |
AddDateTimeDataValidation()
Adds a ExcelDataValidationDateTime to the range
Declaration
IExcelDataValidationDateTime AddDateTimeDataValidation()
Returns
Type | Description |
---|---|
IExcelDataValidationDateTime | A ExcelDataValidationDecimal that can be configured for datetime data validation |
AddDecimalDataValidation()
Adds a ExcelDataValidationDecimal to the range
Declaration
IExcelDataValidationDecimal AddDecimalDataValidation()
Returns
Type | Description |
---|---|
IExcelDataValidationDecimal | A ExcelDataValidationDecimal that can be configured for decimal data validation |
AddIntegerDataValidation()
Adds a ExcelDataValidationInt to the range
Declaration
IExcelDataValidationInt AddIntegerDataValidation()
Returns
Type | Description |
---|---|
IExcelDataValidationInt | A ExcelDataValidationInt that can be configured for integer data validation |
AddListDataValidation()
Adds a IExcelDataValidationList to the range
Declaration
IExcelDataValidationList AddListDataValidation()
Returns
Type | Description |
---|---|
IExcelDataValidationList | A ExcelDataValidationList that can be configured for datetime data validation |
AddTextLengthDataValidation()
Adds a ExcelDataValidationInt regarding text length validation to the range.
Declaration
IExcelDataValidationInt AddTextLengthDataValidation()
Returns
Type | Description |
---|---|
IExcelDataValidationInt |
AddTimeDataValidation()
Adds a IExcelDataValidationTime to the range.
Declaration
IExcelDataValidationTime AddTimeDataValidation()
Returns
Type | Description |
---|---|
IExcelDataValidationTime | A IExcelDataValidationTime that can be configured for time data validation |
ClearDataValidation(Boolean)
Removes validation from the cell/range
Declaration
void ClearDataValidation(bool deleteIfEmpty = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | deleteIfEmpty | Delete the validation if it has no more addresses its being applied to. If set to false an System.InvalidOperationException will be thrown if all addresses of a datavalidation has been cleared. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown if |