---
Product: Aspose.Cells
Platform: python
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/python/datavalidationcollection
---

# DataValidationCollection

## Overview

`DataValidationCollection` is a class in Aspose.Cells FOSS for Python.

Represents a collection of DataValidation objects for a worksheet.

This class declares 12 methods for DataValidationCollection objects in Python programs.
Available methods include: `__getitem__`, `__init__`, `__iter__`, `__len__`, `__repr__`, `add`, `add_validation`, `clear`, `get_validation`, `remove`, `remove_at`, `remove_by_range`.
Public members are accessible to any Python application after installing the Aspose.Cells FOSS for Python package.
Properties: `count`, `disable_prompts`, `x_window`, `y_window`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `count` | - | Read | Gets the number of validations in the collection. |
| `disable_prompts` | - | Read/Write | Gets or sets whether all input prompts are disabled. |
| `x_window` | - | Read/Write | Gets or sets the X coordinate of the dropdown window. |
| `y_window` | - | Read/Write | Gets or sets the Y coordinate of the dropdown window. |

## Methods

| Signature | Description |
|-----------|-------------|
| `__init__()` | Initializes a new DataValidationCollection. |
| `add(sqref, validation_type, operator, formula1, formula2)` | Adds a new data validation to the collection. |
| `add_validation(validation)` | Adds an existing DataValidation object to the collection. |
| `remove(validation)` | Removes a validation from the collection. |
| `remove_at(index)` | Removes a validation at the specified index. |
| `remove_by_range(sqref)` | Removes validations that match the specified range. |
| `clear()` | Removes all validations from the collection. |
| `get_validation(cell_ref)` | Gets the validation that applies to a specific cell. |
| `__len__()` | Returns the number of validations. |
| `__getitem__(index)` | Gets a validation by index. |
| `__iter__()` | Returns an iterator over the validations. |
| `__repr__()` | Returns a string representation of the collection. |

## See Also

- [Aspose.Cells for Python — Enterprise API Reference](https://reference.aspose.com/cells/python-java/)