Aspose::Cells::ValidationCollection class

ValidationCollection class

Represents data validation collection.

class ValidationCollection

Methods

MethodDescription
Add(const CellArea& ca)Adds a data validation to the collection.
Get(int32_t index)Gets the Validation element at the specified index.
GetCount()
GetValidationInCell(int32_t row, int32_t column)Gets the validation applied to given cell.
IsNull() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const ValidationCollection& src)operator=
RemoveACell(int32_t row, int32_t column)Removes all validation setting on the cell.
RemoveArea(const CellArea& ca)Removes all validation setting on the range..
ValidationCollection(ValidationCollection_Impl* impl)Constructs from an implementation object.
ValidationCollection(const ValidationCollection& src)Copy constructor.
~ValidationCollection()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
Workbook workbook;
ValidationCollection validations = workbook.GetWorksheets().Get(0).GetValidations();
CellArea area = CellArea::CreateCellArea(0, 0, 1, 1);
Validation validation = validations.Get(validations.Add(area));
validation.SetType(ValidationType::List);
validation.SetFormula1(u"a,b,c,d");

Aspose::Cells::Cleanup();

See Also