Aspose::Cells::Validation class
Contents
[
Hide
]Validation class
Represents data validation.settings.
class Validation
Methods
| Method | Description |
|---|---|
| AddArea(const CellArea& cellArea) | Applies the validation to the area. |
| AddArea(const CellArea& cellArea, bool checkIntersection, bool checkEdge) | Applies the validation to the area. |
| AddAreas(const Vector <CellArea>& areas, bool checkIntersection, bool checkEdge) | Applies the validation to given areas. |
| Copy(const Validation& source, const CopyOptions& copyOption) | Copy validation. |
| GetAlertStyle() | Represents the validation alert style. |
| GetAreas() | Gets all CellArea which contain the data validation settings. |
| GetErrorMessage() | Represents the data validation error message. |
| GetErrorTitle() | Represents the title of the data-validation error dialog box. |
| GetFormula1(bool isR1C1, bool isLocal) | Gets the value or expression associated with this validation. |
| GetFormula1(bool isR1C1, bool isLocal, int32_t row, int32_t column) | Gets the value or expression associated with this validation for specific cell. |
| GetFormula1() | Represents the value or expression associated with the data validation. |
| GetFormula2(bool isR1C1, bool isLocal) | Gets the value or expression associated with this validation. |
| GetFormula2(bool isR1C1, bool isLocal, int32_t row, int32_t column) | Gets the value or expression associated with this validation for specific cell. |
| GetFormula2() | Represents the value or expression associated with the data validation. |
| GetIgnoreBlank() | Indicates whether blank values are permitted by the range data validation. |
| GetInCellDropDown() | Indicates whether data validation displays a drop-down list that contains acceptable values. |
| GetInputMessage() | Represents the data validation input message. |
| GetInputTitle() | Represents the title of the data-validation input dialog box. |
| GetListValue(int32_t row, int32_t column) | Get the value for list of the validation for the specified cell. |
| GetOperator() | Represents the operator for the data validation. |
| GetShowError() | Indicates whether the data validation error message will be displayed whenever the user enters invalid data. |
| GetShowInput() | Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range. |
| GetType() | Represents the data validation type. |
| GetValue(int32_t row, int32_t column, bool isValue1) | Get the value of validation on the specific cell. |
| GetValue1() | Represents the first value associated with the data validation. |
| GetValue2() | Represents the second value associated with the data validation. |
| IsNull() const | Checks whether the implementation object is nullptr. |
| explicit operator bool() const | operator bool() |
| operator=(const Validation& src) | operator= |
| RemoveACell(int32_t row, int32_t column) | Remove the validation settings in the cell. |
| RemoveArea(const CellArea& cellArea) | Remove the validation settings in the range. |
| RemoveAreas(const Vector <CellArea>& areas) | Removes this validation from given areas. |
| SetAlertStyle(ValidationAlertType value) | Represents the validation alert style. |
| SetErrorMessage(const U16String& value) | Represents the data validation error message. |
| SetErrorMessage(const char16_t* value) | Represents the data validation error message. |
| SetErrorTitle(const U16String& value) | Represents the title of the data-validation error dialog box. |
| SetErrorTitle(const char16_t* value) | Represents the title of the data-validation error dialog box. |
| SetFormula1(const U16String& formula, bool isR1C1, bool isLocal) | Sets the value or expression associated with this validation. |
| SetFormula1(const char16_t* formula, bool isR1C1, bool isLocal) | Sets the value or expression associated with this validation. |
| SetFormula1(const U16String& value) | Represents the value or expression associated with the data validation. |
| SetFormula1(const char16_t* value) | Represents the value or expression associated with the data validation. |
| SetFormula2(const U16String& formula, bool isR1C1, bool isLocal) | Sets the value or expression associated with this validation. |
| SetFormula2(const char16_t* formula, bool isR1C1, bool isLocal) | Sets the value or expression associated with this validation. |
| SetFormula2(const U16String& value) | Represents the value or expression associated with the data validation. |
| SetFormula2(const char16_t* value) | Represents the value or expression associated with the data validation. |
| SetIgnoreBlank(bool value) | Indicates whether blank values are permitted by the range data validation. |
| SetInCellDropDown(bool value) | Indicates whether data validation displays a drop-down list that contains acceptable values. |
| SetInputMessage(const U16String& value) | Represents the data validation input message. |
| SetInputMessage(const char16_t* value) | Represents the data validation input message. |
| SetInputTitle(const U16String& value) | Represents the title of the data-validation input dialog box. |
| SetInputTitle(const char16_t* value) | Represents the title of the data-validation input dialog box. |
| SetOperator(OperatorType value) | Represents the operator for the data validation. |
| SetShowError(bool value) | Indicates whether the data validation error message will be displayed whenever the user enters invalid data. |
| SetShowInput(bool value) | Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range. |
| SetType(ValidationType value) | Represents the data validation type. |
| SetValue1(const Aspose::Cells::Object& value) | Represents the first value associated with the data validation. |
| SetValue2(const Aspose::Cells::Object& value) | Represents the second value associated with the data validation. |
| Validation(Validation_Impl* impl) | Constructs from an implementation object. |
| Validation(const Validation& src) | Copy constructor. |
| ~Validation() | Destructor. |
Fields
| Field | Description |
|---|---|
| _impl | The 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::WholeNumber);
validation.SetOperator(OperatorType::Between);
validation.SetFormula1(u"3");
validation.SetFormula2(u"1234");
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells
- Library Aspose.Cells for C++