Spread Windows Forms 12.0 Product Documentation
NullIsValid Property (CompareValueBaseValidator)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > CompareValueBaseValidator Class : NullIsValid Property
Gets or sets whether the validation always succeeds when the specified value is a null reference (Nothing in Visual Basic).
Syntax
'Declaration
 
Public Property NullIsValid As Boolean
'Usage
 
Dim instance As CompareValueBaseValidator
Dim value As Boolean
 
instance.NullIsValid = value
 
value = instance.NullIsValid
public bool NullIsValid {get; set;}

Property Value

true if the validation always succeeds when the specified value is a null reference (Nothing in Visual Basic); otherwise, false. The default is true.
Remarks
You can determine whether validation is successful if the cell value is a null reference (Nothing in Visual Basic).
Example
This example creates a compare cell validator.
//Type a value not equal to 20 to see the red line
FarPoint.Win.Spread.LineNotify linen = new FarPoint.Win.Spread.LineNotify();
linen.LineColor = Color.Red;
FarPoint.Win.Spread.CompareCellValidator compare = new FarPoint.Win.Spread.CompareCellValidator();
compare.ComparedOperator = FarPoint.Win.Spread.ValidateComparisonOperator.Equals;
compare.DifferenceValue = 10;
compare.NullIsValid = true;
compare.RequiredType = typeof(int);
compare.Row = 0;
compare.Column = 0;
compare.Actions.Add(linen);
fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), compare);
fpSpread1.Sheets[0].Cells[0, 0].Value = 10;
'Type a value Not equal to 20 to see the red line
Dim linen As New FarPoint.Win.Spread.LineNotify()
linen.LineColor = Color.Red
Dim compare As New FarPoint.Win.Spread.CompareCellValidator()
compare.ComparedOperator = FarPoint.Win.Spread.ValidateComparisonOperator.Equals
compare.DifferenceValue = 10
compare.NullIsValid = True
compare.RequiredType = GetType(Integer)
compare.Row = 0
compare.Column = 0
compare.Actions.Add(linen)
FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), compare)
FpSpread1.Sheets(0).Cells(0, 0).Value = 10
See Also

Reference

CompareValueBaseValidator Class
CompareValueBaseValidator Members