Spread Windows Forms 12.0 Product Documentation
RequiredType Property (RangeValidator)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > RangeValidator Class : RequiredType Property
Gets or sets the specified value's required System.Type.
Syntax
'Declaration
 
Public Property RequiredType As Type
'Usage
 
Dim instance As RangeValidator
Dim value As Type
 
instance.RequiredType = value
 
value = instance.RequiredType
public Type RequiredType {get; set;}

Property Value

A System.Type value that represents the specified value's required System.Type. The default is a null reference (Nothing in Visual Basic).
Remarks
Once RequiredType is set to a new value, MinValue and MaxValue are set to a null reference (Nothing in Visual Basic).
Example
This example creates a range validator.
FarPoint.Win.Spread.CellStyleNotify stylenotify = new FarPoint.Win.Spread.CellStyleNotify();
stylenotify.InvalidCellStyle.BackColor = Color.Aquamarine;
FarPoint.Win.Spread.RangeValidator rvalid = new FarPoint.Win.Spread.RangeValidator();
rvalid.MaxValue = 10;
rvalid.MinValue = 0;
rvalid.NullIsValid = true;
rvalid.RequiredType = typeof(int);
rvalid.Actions.Add(stylenotify);
fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), rvalid);
Dim stylenotify As New FarPoint.Win.Spread.CellStyleNotify()
stylenotify.InvalidCellStyle.BackColor = Color.Aquamarine
Dim rvalid As New FarPoint.Win.Spread.RangeValidator()
rvalid.MaxValue = 10
rvalid.MinValue = 0
rvalid.NullIsValid = True
rvalid.RequiredType = GetType(Integer)
rvalid.Actions.Add(stylenotify)
FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), rvalid)
See Also

Reference

RangeValidator Class
RangeValidator Members