Spread Windows Forms 12.0 Product Documentation
Add(Int32,Int32,Int32,Int32,DataValidationType,DataValidationErrorStyle,DataValidationOperator,String,String) Method


GrapeCity.Spreadsheet Assembly > GrapeCity.Spreadsheet Namespace > DataValidations Class > Add Method : Add(Int32,Int32,Int32,Int32,DataValidationType,DataValidationErrorStyle,DataValidationOperator,String,String) Method
An integer value indicates the top row index of cell range.
An integer value indicates the left column index of cell range.
An integer value indicates the bottom row index of cell range.
An integer value indicates the right column index of cell range.
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.
Adds data validation to the specified range.
Syntax
'Declaration
 
Public Overloads Function Add( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal row2 As Integer, _
   ByVal column2 As Integer, _
   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 row As Integer
Dim column As Integer
Dim row2 As Integer
Dim column2 As Integer
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(row, column, row2, column2, type, errorStyle, operator, formula1, formula2)
public DataValidation Add( 
   int row,
   int column,
   int row2,
   int column2,
   DataValidationType type,
   DataValidationErrorStyle errorStyle,
   DataValidationOperator operator,
   string formula1,
   string formula2
)

Parameters

row
An integer value indicates the top row index of cell range.
column
An integer value indicates the left column index of cell range.
row2
An integer value indicates the bottom row index of cell range.
column2
An integer value indicates the right column index of cell range.
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

Reference

DataValidations Class
DataValidations Members
Overload List