Spread Windows Forms 17
GrapeCity.Spreadsheet Assembly / GrapeCity.Spreadsheet Namespace / DataValidations Class / Add Method / Add(Reference,DataValidationType,DataValidationErrorStyle,DataValidationOperator,String,String) Method
A Reference value indicates the reference of this DataValidation.
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(Reference,DataValidationType,DataValidationErrorStyle,DataValidationOperator,String,String) Method
    In This Topic
    Adds data validation to the specified range.
    Syntax
    'Declaration
     
    
    Public Overloads Function Add( _
       ByVal rangeRef As Reference, _
       ByVal type As DataValidationType, _
       ByVal errorStyle As DataValidationErrorStyle, _
       ByVal operator As DataValidationOperator, _
       ByVal formula1 As String, _
       Optional ByVal formula2 As String _
    ) As DataValidation
    'Usage
     
    
    Dim instance As DataValidations
    Dim rangeRef As Reference
    Dim type As DataValidationType
    Dim errorStyle As DataValidationErrorStyle
    Dim operator As DataValidationOperator
    Dim formula1 As String
    Dim formula2 As String
    Dim value As DataValidation
     
    value = instance.Add(rangeRef, type, errorStyle, operator, formula1, formula2)

    Parameters

    rangeRef
    A Reference value indicates the reference of this DataValidation.
    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

    A DataValidation instance represents the created data validation. null if the data is invalid.
    Remarks
    All existed data validations in the specified range will be removed.
    See Also