Class
NumberDataValidationRuleBase

Abstract base for numeric data validation rules that compare cell values against numeric boundaries using comparison operators.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model.DataValidation

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

cs-api-definition
public abstract class NumberDataValidationRuleBase : SingleArgumentDataValidationRuleBase, IDataValidationRule

Inheritance: objectDataValidationRuleBaseSingleArgumentDataValidationRuleBaseNumberDataValidationRuleBase

Derived Classes: DateDataValidationRuleDecimalDataValidationRuleTextLengthDataValidationRuleTimeDataValidationRuleWholeNumberDataValidationRule

Implements: IDataValidationRule

Inherited Members SingleArgumentDataValidationRuleBase.IgnoreBlankSingleArgumentDataValidationRuleBase.CellIndexSingleArgumentDataValidationRuleBase.Argument1DataValidationRuleBase.Evaluate(Worksheet, int, int, ICellValue)DataValidationRuleBase.ShowInputMessageDataValidationRuleBase.InputMessageTitleDataValidationRuleBase.InputMessageContentDataValidationRuleBase.ShowErrorMessageDataValidationRuleBase.ErrorStyleDataValidationRuleBase.ErrorAlertTitleDataValidationRuleBase.ErrorAlertContent

Constructors

NumberDataValidationRuleBase(NumberDataValidationRuleContext)

Initializes a new NumberDataValidationRuleBase from the specified numeric validation context.

Declaration

cs-api-definition
protected NumberDataValidationRuleBase(NumberDataValidationRuleContext context)

Parameters

context

NumberDataValidationRuleContext

The context.

Properties

Argument2

Second boundary value for range-based comparisons such as Between and NotBetween operators.

Declaration

cs-api-definition
public ICellValue Argument2 { get; }

Property Value

ICellValue

The second argument.

ComparisonOperator

Comparison operator used to evaluate the cell value against the validation arguments.

Declaration

cs-api-definition
public ComparisonOperator ComparisonOperator { get; }

Property Value

ComparisonOperator

The comparison operator.

RequireWholeNumbers

Indicates whether the rule restricts input to whole numbers without decimal fractions.

Declaration

cs-api-definition
protected virtual bool RequireWholeNumbers { get; }

Property Value

bool

The value indicating if the rule requires whole numbers as a result of the argument expression.

Methods

CompareValues(double?, double?, double?)

Compares the cell value against the validation arguments using the configured comparison operator.

Declaration

cs-api-definition
protected bool CompareValues(double? cellValueResult, double? argument1, double? argument2)

Parameters

cellValueResult

double?

The cell value result.

argument1

double?

The argument1.

argument2

double?

The argument2.

Returns

bool

Retrurns True if the rule is satisfied, else returns False.

Equals(object)

Determines whether the specified object is equal to the current object.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Overrides SingleArgumentDataValidationRuleBase.Equals(object)

EvaluateOverride(Worksheet, int, int, ICellValue)

Evaluates the numeric validation rule by comparing the cell value against the configured numeric boundaries.

Declaration

cs-api-definition
protected override bool EvaluateOverride(Worksheet worksheet, int rowIndex, int columnIndex, ICellValue cellValue)

Parameters

worksheet

Worksheet

The worksheet.

rowIndex

int

Index of the row.

columnIndex

int

Index of the column.

cellValue

ICellValue

The cell value.

Returns

bool

Retrurns True if the rule is satisfied, else returns False.

Overrides DataValidationRuleBase.EvaluateOverride(Worksheet, int, int, ICellValue)

GetHashCode()

Serves as a hash function for a particular type.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

A hash code for the current object.

Overrides SingleArgumentDataValidationRuleBase.GetHashCode()