Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / RequiredTypeValidator Class / RequiredType Property

In This Topic
    RequiredType Property (RequiredTypeValidator)
    In This Topic
    Gets or sets the specified value's required System.Type.
    Public Property RequiredType As Type
    Dim instance As RequiredTypeValidator
    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).
    This example requires a decimal or null in cell 1,1.
    //Type a text string in cell 1,1 to see the error notification
    FarPoint.Win.Spread.CellStyleNotify cnotify = new FarPoint.Win.Spread.CellStyleNotify();
    cnotify.InvalidCellStyle.BackColor = Color.Aqua;
    FarPoint.Win.Spread.RequiredTypeValidator requiredt = new FarPoint.Win.Spread.RequiredTypeValidator();
    requiredt.RequiredType = typeof(decimal);
    requiredt.NullIsValid = true;
    fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), requiredt);
    fpSpread1.Sheets[0].Cells[1, 1].Value = 5;
    'Type a text string in cell 1,1 to see the error notification
    Dim cnotify As New FarPoint.Win.Spread.CellStyleNotify()
    cnotify.InvalidCellStyle.BackColor = Color.Aqua
    Dim requiredt As New FarPoint.Win.Spread.RequiredTypeValidator()
    requiredt.RequiredType = GetType(Decimal)
    requiredt.NullIsValid = True
    FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), requiredt)
    FpSpread1.Sheets(0).Cells(1, 1).Value = 5
    See Also