Validation Class
Represents data validation.settings.
Inheritance Hierarchy
SystemObject
  Aspose.CellsValidation

Namespace: Aspose.Cells
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.9.0.0 (19.9)
Syntax
public class Validation

The Validation type exposes the following members.

Properties
  NameDescription
Public propertyAlertStyle
Represents the validation alert style.
Public propertyAreas
Gets all CellArea which contain the data validation settings.
Public propertyErrorMessage
Represents the data validation error message.
Public propertyErrorTitle
Represents the title of the data-validation error dialog box.
Public propertyFormula1
Represents the value or expression associated with the data validation.
Public propertyFormula2
Represents the value or expression associated with the data validation.
Public propertyIgnoreBlank
Indicates whether blank values are permitted by the range data validation.
Public propertyInCellDropDown
Indicates whether data validation displays a drop-down list that contains acceptable values.
Public propertyInputMessage
Represents the data validation input message.
Public propertyInputTitle
Represents the title of the data-validation input dialog box.
Public propertyOperator
Represents the operator for the data validation.
Public propertyShowError
Indicates whether the data validation error message will be displayed whenever the user enters invalid data.
Public propertyShowInput
Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.
Public propertyType
Represents the data validation type.
Public propertyValue1
Represents the first value associated with the data validation.
Public propertyValue2
Represents the second value associated with the data validation.
Methods
  NameDescription
Public methodAddArea
Applies the validation to the area.
Public methodCopy
Copy validation.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetFormula1(Boolean, Boolean)
Gets the value or expression associated with this validation.
Public methodGetFormula1(Boolean, Boolean, Int32, Int32)
Gets the value or expression associated with this validation for specific cell.
Public methodGetFormula2(Boolean, Boolean)
Gets the value or expression associated with this validation.
Public methodGetFormula2(Boolean, Boolean, Int32, Int32)
Gets the value or expression associated with this validation for specific cell.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetListValue
Get the value for list of the validation for the specified cell.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemoveACell
Remove the validation settings in the cell.
Public methodRemoveArea
Remove the validation settings in the range.
Public methodSetFormula1
Sets the value or expression associated with this validation.
Public methodSetFormula2
Sets the value or expression associated with this validation.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
[C#]
Workbook workbook = new Workbook();
   ValidationCollection validations = workbook.Worksheets[0].Validations;
   Validation validation = validations[validations.Add()];
   validation.Type = Aspose.Cells.ValidationType.WholeNumber;
   validation.Operator = OperatorType.Between;
   validation.Formula1 = "3";
   validation.Formula2 = "1234";

   CellArea area;
   area.StartRow = 0;
   area.EndRow = 1;
   area.StartColumn = 0;
   area.EndColumn = 1;

   validation.AreaList.Add(area);

   [Visual Basic]
   Dim workbook as Workbook = new Workbook()
   Dim validations as ValidationCollection  = workbook.Worksheets(0).Validations
   Dim validation as Validation = validations(validations.Add())
   validation.Type = ValidationType.WholeNumber
   validation.Operator = OperatorType.Between
   validation.Formula1 = "3"
   validation.Formula2 = "1234"

   Dim area as CellArea
   area.StartRow = 0
   area.EndRow = 1
   area.StartColumn = 0
   area.EndColumn = 1

   validation.AreaList.Add(area)
See Also