Spread WPF Documentation
CreateDateValidator Method
Example 


The type of ComparisonOperator compare operator.
The first object.
The second object.
true if the validator is set to time; otherwise, false.
Creates a validator based on the data.
Syntax
'Declaration
 
Public Shared Function CreateDateValidator( _
   ByVal typeOperator As ComparisonOperator, _
   ByVal v1 As System.Object, _
   ByVal v2 As System.Object, _
   ByVal isTime As System.Boolean _
) As DataValidator
'Usage
 
Dim typeOperator As ComparisonOperator
Dim v1 As System.Object
Dim v2 As System.Object
Dim isTime As System.Boolean
Dim value As DataValidator
 
value = DataValidator.CreateDateValidator(typeOperator, v1, v2, isTime)
public static DataValidator CreateDateValidator( 
   ComparisonOperator typeOperator,
   System.object v1,
   System.object v2,
   System.bool isTime
)

Parameters

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

Return Value

Returns a new validator.
Example
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"
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional (SP4), Windows XP (SP2), Windows 2008, Windows 2003 Server (SP1)

See Also

Reference

DataValidator Class
DataValidator Members

 

 


Copyright © GrapeCity, inc. All rights reserved.