New to Telerik Document ProcessingStart a free 30-day trial

Abstract base for data validation rules, providing common infrastructure for input messages, error alerts, and validation evaluation.

Definition

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

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public abstract class DataValidationRuleBase : IDataValidationRule

Inheritance: objectDataValidationRuleBase

Derived Classes: AnyValueDataValidationRuleSingleArgumentDataValidationRuleBase

Implements: IDataValidationRule

Constructors

Initializes a new DataValidationRuleBase from the specified configuration context.

C#
protected DataValidationRuleBase(DataValidationRuleContextBase context)
Parameters:contextDataValidationRuleContextBase

The context.

Methods

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

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with the current object.

Returns:

bool

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

Overrides: object.Equals(object)

Evaluates whether the specified cell value satisfies the validation rule and returns the validation result.

C#
public bool Evaluate(Worksheet worksheet, int rowIndex, int columnIndex, ICellValue cellValue)
Parameters:worksheetWorksheet

The worksheet.

rowIndexint

Index of the row.

columnIndexint

Index of the column.

cellValueICellValue
Returns:

bool

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

Implements: IDataValidationRule.Evaluate(Worksheet, int, int, ICellValue)

Override to implement rule-specific validation logic that determines whether the cell value is valid.

C#
protected abstract bool EvaluateOverride(Worksheet worksheet, int rowIndex, int columnIndex, ICellValue cellValue)
Parameters:worksheetWorksheet

The worksheet.

rowIndexint

Index of the row.

columnIndexint

Index of the column.

cellValueICellValue

The cell value.

Returns:

bool

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

Serves as a hash function for a particular type.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: object.GetHashCode()

Properties

Descriptive text in the error alert explaining why the input was rejected.

C#
public string ErrorAlertContent { get; }
Property Value:

The content of the error alert.

Implements: IDataValidationRule.ErrorAlertContent

Title text displayed in the error alert dialog when validation fails.

C#
public string ErrorAlertTitle { get; }
Property Value:

The error alert title.

Implements: IDataValidationRule.ErrorAlertTitle

Severity level of the error alert, determining whether invalid input is blocked or allowed.

C#
public ErrorStyle ErrorStyle { get; }
Property Value:

The error style.

Implements: IDataValidationRule.ErrorStyle

Descriptive text in the input prompt explaining valid values or constraints to the user.

C#
public string InputMessageContent { get; }
Property Value:

The content of the input message.

Implements: IDataValidationRule.InputMessageContent

Title text displayed in the input prompt when the user selects a validated cell.

C#
public string InputMessageTitle { get; }
Property Value:

The input message title.

Implements: IDataValidationRule.InputMessageTitle

Indicates whether an error alert is displayed when the user enters invalid data.

C#
public bool ShowErrorMessage { get; }
Property Value:

The value indicating whether an input message should be shown.

Implements: IDataValidationRule.ShowErrorMessage

Indicates whether an input prompt is displayed when the cell is selected, guiding users on valid input.

C#
public bool ShowInputMessage { get; }
Property Value:

The value indicating whether an input message should be shown.

Implements: IDataValidationRule.ShowInputMessage