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
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 |
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. |