Table of Contents

Interface IXLDataValidations

Namespace
SlapKit.Excel.Excel
Assembly
SlapKit.Excel.dll
public interface IXLDataValidations : IEnumerable<IXLDataValidation>, IEnumerable
Inherited Members
Extension Methods

Properties

Worksheet

IXLWorksheet Worksheet { get; }

Property Value

IXLWorksheet

Methods

Add(IXLDataValidation)

Add data validation rule to the collection. If the specified rule refers to another worksheet than the collection, the copy will be created and its ranges will refer to the worksheet of the collection. Otherwise the original instance will be placed in the collection.

IXLDataValidation Add(IXLDataValidation dataValidation)

Parameters

dataValidation IXLDataValidation

A data validation rule to add.

Returns

IXLDataValidation

The instance that has actually been added in the collection (may be a copy of the specified one).

ContainsSingle(IXLRange)

bool ContainsSingle(IXLRange range)

Parameters

range IXLRange

Returns

bool

Delete(Predicate<IXLDataValidation>)

void Delete(Predicate<IXLDataValidation> predicate)

Parameters

predicate Predicate<IXLDataValidation>

GetAllInRange(IXLRangeAddress)

Get all data validation rules applied to ranges that intersect the specified range.

IEnumerable<IXLDataValidation> GetAllInRange(IXLRangeAddress rangeAddress)

Parameters

rangeAddress IXLRangeAddress

Returns

IEnumerable<IXLDataValidation>

TryGet(IXLRangeAddress, out IXLDataValidation)

Get the data validation rule for the range with the specified address if it exists.

bool TryGet(IXLRangeAddress rangeAddress, out IXLDataValidation dataValidation)

Parameters

rangeAddress IXLRangeAddress

A range address.

dataValidation IXLDataValidation

Data validation rule which ranges collection includes the specified address. The specified range should be fully covered with the data validation rule. For example, if the rule is applied to ranges A1:A3,C1:C3 then this method will return True for ranges A1:A3, C1:C2, A2:A3, and False for ranges A1:C3, A1:C1, etc.

Returns

bool

True is the data validation rule was found, false otherwise.