Class ValidationRule
- Namespace
- FileFormat.Cells
- Assembly
- FileFormat.Cells.dll
Represents a validation rule that can be applied to a cell or range of cells.
public class ValidationRule
- Inheritance
-
ValidationRule
- Inherited Members
Constructors
ValidationRule(ValidationType, double, double)
Initializes a new instance of the ValidationRule class for numeric (whole number, decimal) or text length validations.
public ValidationRule(ValidationType type, double minValue, double maxValue)
Parameters
type
ValidationTypeThe type of validation (whole number, decimal, text length).
minValue
doubleThe minimum value for the validation.
maxValue
doubleThe maximum value for the validation.
Exceptions
- ArgumentException
Thrown if the type is not numeric or text length.
ValidationRule(string)
Initializes a new instance of the ValidationRule class for custom formula validation.
public ValidationRule(string customFormula)
Parameters
customFormula
stringThe custom formula for the validation.
ValidationRule(string[])
Initializes a new instance of the ValidationRule class for list validation.
public ValidationRule(string[] options)
Parameters
options
string[]The options for the list validation.
Properties
CustomFormula
Gets or sets the custom formula for custom formula validation.
public string CustomFormula { get; set; }
Property Value
ErrorMessage
Gets or sets the error message displayed when validation fails.
public string ErrorMessage { get; set; }
Property Value
ErrorTitle
Gets or sets the title of the error dialog that appears when validation fails.
public string ErrorTitle { get; set; }
Property Value
MaxValue
Gets or sets the maximum value for numeric or text length validation.
public double? MaxValue { get; set; }
Property Value
MinValue
Gets or sets the minimum value for numeric or text length validation.
public double? MinValue { get; set; }
Property Value
Options
Gets or sets the list of options for list validation.
public string[] Options { get; set; }
Property Value
- string[]
Type
Gets or sets the type of validation.
public ValidationType Type { get; set; }