Exception | Description |
---|---|
System.ArgumentException | Occurs when value cannot be represented as a date in Excel. |
System.ArgumentException | Occurs when the specified value is greater than the upper constraint value. If the upper constraint formula does not equal a constant, this verification is not performed. |
The way in which the cell value is compared to the lower constraint value is determined by the ValidationOperator as well as the ValueConstraintDataValidationRule.ValidationCriteria.
Depending on the ValidationCriteria of the rule, either the cell value itself or the length of the cell value's text equivalent is compared to the lower constraint value.
When the ValidationOperator is Between, the value must be greater than or equal to the lower constraint and less than or equal to the upper constraint. When the ValidationOperator is NotBetween, the value must be less than the lower constraint or greater than the upper constraint.
This overload is preferred when the ValidationCriteria is Date. When the ValidationCriteria is WholeNumber, Decimal, or TextLength, the SetLowerConstraint(Double) overload is preferred, and when the ValidationCriteria is Time, the SetLowerConstraint(TimeSpan) overload is preferred.
Target Platforms: Android 4.4+, iOS 8+
Development Environments: Visual Studio 2015+, Visual Studio for Mac Preview, Xamarin for Visual Studio 4.2+
TwoConstraintDataValidationRule Class
TwoConstraintDataValidationRule Members
Overload List
SetLowerConstraint(Double) Method
SetLowerConstraint(TimeSpan) Method
SetLowerConstraintFormula(String,String) Method
SetLowerConstraintFormula(String,String,WorkbookFormat,CellReferenceMode,CultureInfo) Method
SetUpperConstraint(DateTime) Method
ValidationOperator Property
ValidationCriteria Property