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


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

Property Value

true if the validation is always successful when the specified value is a null reference (Nothing in Visual Basic); otherwise, false. The default is true.
Remarks
If the cell value is a null reference (Nothing in Visual Basic), you can determine whether the validation always succeeds.
Example
This example uses the regular expression validator.
//The error backcolor is displayed if the value is invalid
FarPoint.Win.Spread.CellStyleNotify cnotify = new FarPoint.Win.Spread.CellStyleNotify();
cnotify.InvalidCellStyle.BackColor = Color.Lime;
FarPoint.Win.Spread.RegularExpressionValidator rvalidator = new FarPoint.Win.Spread.RegularExpressionValidator();
rvalidator.Expression = "AA";
rvalidator.RegexOptions = System.Text.RegularExpressions.RegexOptions.IgnoreCase;
rvalidator.NullIsValid = true;
rvalidator.Actions.Add(cnotify);
fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), rvalidator);
'The error backcolor is displayed if the value is invalid
Dim cnotify As New FarPoint.Win.Spread.CellStyleNotify()
cnotify.InvalidCellStyle.BackColor = Color.Lime
Dim rvalidator As New FarPoint.Win.Spread.RegularExpressionValidator()
rvalidator.Expression = "AA"
rvalidator.RegexOptions = System.Text.RegularExpressions.RegexOptions.IgnoreCase
rvalidator.NullIsValid = True
rvalidator.Actions.Add(cnotify)
FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), rvalidator)
See Also

Reference

RegularExpressionValidator Class
RegularExpressionValidator Members