Search Results for

    Show / Hide Table of Contents

    Class DataValidation

    Represents a data validation rule. A data validation rule can be applied to a range of cells. The rule specifies the type of data that can be entered in the cells of the range. Additionally, the rule can limit the values to values in a list of allowable values that is specified by the user.

    Inheritance
    System.Object
    DataValidation
    Namespace: IronXL.DataValidations
    Assembly: IronXL.dll
    Syntax
    public class DataValidation : Object

    Properties

    ComparisonOperator

    The operator used by the data validation rule. This property is only used for whole number, decimal, date, time, and text length data validation rules. For all other types of data validation rules, this property returns IronXL.DataValidations.ComparisonOperator.None.

    Declaration
    public ComparisonOperator ComparisonOperator { get; set; }
    Property Value
    Type Description
    ComparisonOperator

    ConstrainedRangeAddress

    The range of cells to which this data validation rule applies.

    Declaration
    public RangeAddress ConstrainedRangeAddress { get; }
    Property Value
    Type Description
    RangeAddress

    ConstraintType

    The type of data validation rule.

    Declaration
    public ConstraintType ConstraintType { get; }
    Property Value
    Type Description
    ConstraintType

    EmptyCellAllowed

    Controlls wether the empty cell is allowed by the data validation rule.

    Declaration
    public bool EmptyCellAllowed { get; set; }
    Property Value
    Type Description
    System.Boolean

    ErrorAlert

    The style of error alert used by the data validation rule.

    • Stop Displays an error alert dialog box with a Stop icon in its title bar.
    • Warning Displays an error alert dialog box with a Warning icon in its title bar.
    • Information Displays an error alert dialog box with an Information icon in its title bar.
    Declaration
    public ErrorAlert ErrorAlert { get; set; }
    Property Value
    Type Description
    ErrorAlert

    ErrorBoxText

    The text of the error alert dialog box.

    Declaration
    public string ErrorBoxText { get; set; }
    Property Value
    Type Description
    System.String

    ErrorBoxTitle

    The title of the error alert dialog box.

    Declaration
    public string ErrorBoxTitle { get; set; }
    Property Value
    Type Description
    System.String

    Formula1

    The first formula used by the data validation rule. For list data validation rules, this formula specifies the list of allowable values. For Custom data validation rules, this formula specifies the custom validation formula.

    Declaration
    public string Formula1 { get; }
    Property Value
    Type Description
    System.String

    Formula2

    The second formula used by the data validation rule. This formula is only used by whole number, decimal, date, time, and text length data validation rules. For all other types of data validation rules, this property returns System.String.Empty or null.

    Declaration
    public string Formula2 { get; }
    Property Value
    Type Description
    System.String

    PromptBoxText

    The title of the prompt box.

    Declaration
    public string PromptBoxText { get; set; }
    Property Value
    Type Description
    System.String

    PromptBoxTitle

    The text of the prompt box.

    Declaration
    public string PromptBoxTitle { get; set; }
    Property Value
    Type Description
    System.String

    ShowDropDownList

    Controlls wether the dropdown arrow is shown in the cell. This property is only used for list and custom data validation rules. It will return false for all other types of data validation rules.

    Declaration
    public bool ShowDropDownList { get; set; }
    Property Value
    Type Description
    System.Boolean

    ShowErrorBox

    Controlls wether the error alert is shown when the data validation rule is violated.

    Declaration
    public bool ShowErrorBox { get; set; }
    Property Value
    Type Description
    System.Boolean

    ShowPromptBox

    Controlls wether the prompt box is shown when the cell is selected.

    Declaration
    public bool ShowPromptBox { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Equals(Object)

    An override for the System.Object.ToString() method.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    An object to compare with this instance.

    Returns
    Type Description
    System.Boolean

    true if obj is equal to this instance; otherwise, false.

    GetHashCode()

    An override for the System.Object.GetHashCode() method.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    A hash code for this instance.

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronXL_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronXL