Version

Add(DataValidationRule,WorksheetReferenceCollection,Boolean) Method

Applies a data validation rule to the a set of references.
Syntax

Parameters

rule
The data validation rule to apply to the set of references.
references
The reference to which the data validation rule should be applied.
overwriteExistingRules
Indicates whether cells in the references collection which already have data validation rules should have the rules overwritten.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionOccurs when rule is null.
System.ArgumentNullExceptionOccurs when references is null.
System.ArgumentExceptionOccurs when the references are from a worksheet other than this collection.
System.ArgumentExceptionOccurs when the rule already applied to another worksheet.
System.ArgumentExceptionOccurs when the rule is invalid based on its rule type's requirements.
System.ArgumentExceptionOccurs when overwriteExistingRules is False and the one or more of the cells in the references collection already have a data validation rule applied to it.
System.ArgumentExceptionOccurs when the one or more of the cells in the references collection are in the totals row of a table.
Requirements

Target Platforms: Android 4.4+, iOS 8+

Development Environments: Visual Studio 2015+, Visual Studio for Mac Preview, Xamarin for Visual Studio 4.2+

See Also