Search Results for

    Show / Hide Table of Contents

    Class ConstraintType

    The type of data validation to apply to a cell or range of cells.

    Inheritance
    System.Object
    ConstraintType
    Namespace: IronXL.DataValidations
    Assembly: IronXL.dll
    Syntax
    public sealed class ConstraintType : Enum

    ConstraintType names the kind of data a validation rule allows in a cell, reported by the ConstraintType property on a DataValidation. WholeNumber and Decimal restrict numbers, Date and Time restrict temporal entries, and TextLength constrains character count. List limits a cell to a drop-down set, Custom validates against a formula, and AnyData applies no restriction. The factory methods on a worksheet's DataValidations set the matching constraint automatically. The data validation example shows typed rules.

    DataValidation rule = sheet.DataValidations.AddDecimalRule("A1:A10", ComparisonOperator.GreaterThan, 0, null);

    Fields

    AnyData

    Any value is valid.

    Declaration
    public const ConstraintType AnyData
    Field Value
    Type Description
    ConstraintType

    Custom

    A custom formula is valid.

    Declaration
    public const ConstraintType Custom
    Field Value
    Type Description
    ConstraintType

    Date

    A date is valid. The ComparisonOperator can then be used to specify the comparison operator for the date.

    Declaration
    public const ConstraintType Date
    Field Value
    Type Description
    ConstraintType

    Decimal

    A decimal number is valid. The ComparisonOperator can then be used to specify the comparison operator for the decimal number.

    Declaration
    public const ConstraintType Decimal
    Field Value
    Type Description
    ConstraintType

    List

    A list of values is valid.

    Declaration
    public const ConstraintType List
    Field Value
    Type Description
    ConstraintType

    TextLength

    A text length is valid. The ComparisonOperator can then be used to specify the comparison operator for the text length.

    Declaration
    public const ConstraintType TextLength
    Field Value
    Type Description
    ConstraintType

    Time

    A time is valid. The ComparisonOperator can then be used to specify the comparison operator for the time.

    Declaration
    public const ConstraintType Time
    Field Value
    Type Description
    ConstraintType

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32

    WholeNumber

    A whole number is valid. The ComparisonOperator can then be used to specify the comparison operator for the whole number.

    Declaration
    public const ConstraintType WholeNumber
    Field Value
    Type Description
    ConstraintType
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget