Spread Windows Forms 13.0 Product Documentation
GrapeCity.Spreadsheet Assembly / GrapeCity.Spreadsheet Namespace / IValidation Interface / Add Method
A DataValidationType value indicates the type of data validation to add.
A DataValidationErrorStyle value indicates the error style to use for error messages.
A DataValidationOperator value indicates the data validation operator.
A string value indicates the first data validation value, formula or list.
A string value indicates the second data validation value for DataValidationOperator.Between or DataValidationOperator.NotBetween.


In This Topic
    Add Method (IValidation)
    In This Topic
    Adds data validation to a range of cells using the specified options.
    Syntax
    'Declaration
     
    Function Add( _
       ByVal type As DataValidationType, _
       Optional ByVal errorStyle As DataValidationErrorStyle, _
       Optional ByVal operator As DataValidationOperator, _
       Optional ByVal formula1 As String, _
       Optional ByVal formula2 As String _
    ) As IValidation
    'Usage
     
    Dim instance As IValidation
    Dim type As DataValidationType
    Dim errorStyle As DataValidationErrorStyle
    Dim operator As DataValidationOperator
    Dim formula1 As String
    Dim formula2 As String
    Dim value As IValidation
     
    value = instance.Add(type, errorStyle, operator, formula1, formula2)

    Parameters

    type
    A DataValidationType value indicates the type of data validation to add.
    errorStyle
    A DataValidationErrorStyle value indicates the error style to use for error messages.
    operator
    A DataValidationOperator value indicates the data validation operator.
    formula1
    A string value indicates the first data validation value, formula or list.
    formula2
    A string value indicates the second data validation value for DataValidationOperator.Between or DataValidationOperator.NotBetween.

    Return Value

    The new created data validation. null if the data validation cannot be added.
    Remarks
    Because formula1 and formula2 properties are also used for primitive value, the formula must start with "=".
    See Also