Spread WPF 15
GrapeCity.Windows.SpreadSheet.Data Namespace / DataValidator Class / CreateDateValidator Method
The type of ComparisonOperator compare operator.
The first object.
The second object.
true if the validator is set to time; otherwise, false.

In This Topic
    CreateDateValidator Method
    In This Topic
    Creates a validator based on the data.
    Public Shared Function CreateDateValidator( _
       ByVal typeOperator As ComparisonOperator, _
       ByVal v1 As Object, _
       ByVal v2 As Object, _
       ByVal isTime As Boolean _
    ) As DataValidator
    Dim typeOperator As ComparisonOperator
    Dim v1 As Object
    Dim v2 As Object
    Dim isTime As Boolean
    Dim value As DataValidator
    value = DataValidator.CreateDateValidator(typeOperator, v1, v2, isTime)
    public static DataValidator CreateDateValidator( 
       ComparisonOperator typeOperator,
       object v1,
       object v2,
       bool isTime


    The type of ComparisonOperator compare operator.
    The first object.
    The second object.
    true if the validator is set to time; otherwise, false.

    Return Value

    Returns a new validator.
    This example uses the CreateDateValidator method.
    //Type a date in cell (0,1)
    gcSpreadSheet1.HighlightInvalidData = true;
    var valid = GrapeCity.Windows.SpreadSheet.Data.DataValidator.CreateDateValidator(GrapeCity.Windows.SpreadSheet.Data.ComparisonOperator.Between, new System.DateTime(2012, 12, 31), DateTime.Now, false);             
    gcSpreadSheet1.Sheets[0].Cells[0, 1].DataValidator = valid;
    gcSpreadSheet1.Sheets[0].Cells[0, 0].Text = "Formulas";
    'Type a date in cell (0,1)
    GcSpreadSheet1.HighlightInvalidData = True
    Dim valid = GrapeCity.Windows.SpreadSheet.Data.DataValidator.CreateDateValidator(GrapeCity.Windows.SpreadSheet.Data.ComparisonOperator.Between, New System.DateTime(2012, 12, 31), DateTime.Now, False)
    GcSpreadSheet1.Sheets(0).Cells(0, 1).DataValidator = valid
    GcSpreadSheet1.Sheets(0).Cells(0, 0).Text = "Formulas"
    See Also