Class
DataValidationRuleBase

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:

cs-api-definition
public abstract class DataValidationRuleBase : IDataValidationRule

Inheritance: objectDataValidationRuleBase

Derived Classes: AnyValueDataValidationRuleSingleArgumentDataValidationRuleBase

Implements: IDataValidationRule

Constructors

DataValidationRuleBase(DataValidationRuleContextBase)

Initializes a new DataValidationRuleBase from the specified configuration context.

Declaration

cs-api-definition
protected DataValidationRuleBase(DataValidationRuleContextBase context)

Parameters

context

DataValidationRuleContextBase

The context.

Properties

ErrorAlertContent

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

Declaration

cs-api-definition
public string ErrorAlertContent { get; }

Property Value

string

The content of the error alert.

Implements IDataValidationRule.ErrorAlertContent

ErrorAlertTitle

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

Declaration

cs-api-definition
public string ErrorAlertTitle { get; }

Property Value

string

The error alert title.

Implements IDataValidationRule.ErrorAlertTitle

ErrorStyle

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

Declaration

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

Property Value

ErrorStyle

The error style.

Implements IDataValidationRule.ErrorStyle

InputMessageContent

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

Declaration

cs-api-definition
public string InputMessageContent { get; }

Property Value

string

The content of the input message.

Implements IDataValidationRule.InputMessageContent

InputMessageTitle

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

Declaration

cs-api-definition
public string InputMessageTitle { get; }

Property Value

string

The input message title.

Implements IDataValidationRule.InputMessageTitle

ShowErrorMessage

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

Declaration

cs-api-definition
public bool ShowErrorMessage { get; }

Property Value

bool

The value indicating whether an input message should be shown.

Implements IDataValidationRule.ShowErrorMessage

ShowInputMessage

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

Declaration

cs-api-definition
public bool ShowInputMessage { get; }

Property Value

bool

The value indicating whether an input message should be shown.

Implements IDataValidationRule.ShowInputMessage

Methods

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 object.Equals(object)

Evaluate(Worksheet, int, int, ICellValue)

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

Declaration

cs-api-definition
public bool Evaluate(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

Returns

bool

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

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

EvaluateOverride(Worksheet, int, int, ICellValue)

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

Declaration

cs-api-definition
protected abstract 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.

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 object.GetHashCode()