ValidationStore Class

Class that manages validation rules for cells in a spreadsheet.

Inheritance

Object

Documents.Spreadsheet.ValidationStore

Namespace: Radzen.Documents.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

public class ValidationStore

Constructors

ValidationStoreLink to this section

Initializes a new instance of the ValidationStore class.

Declaration
public ValidationStore(Documents.Spreadsheet.Worksheet worksheet)
Parameters
Type Name Description
Documents.Spreadsheet.Worksheet worksheet The owning worksheet, notified via ChromeChanged when validation changes. May be null for a standalone store.

Properties

RangesLink to this section

Gets all ranges that have validation rules.

Declaration
public IEnumerable<Documents.Spreadsheet.RangeRef> Ranges { get; }
Property Value
Type Description
IEnumerable<Documents.Spreadsheet.RangeRef>Gets all ranges that have validation rules.

Methods

AddLink to this section

Adds a validation rule for a specific range of cells in the spreadsheet.

Declaration
public void Add(Documents.Spreadsheet.RangeRef range, Documents.Spreadsheet.ICellValidator[] validators)
Parameters
Type Name Description
Documents.Spreadsheet.RangeRef range
Documents.Spreadsheet.ICellValidator[] validators

AddLink to this section

Adds a validation rule for a specific range of cells in the spreadsheet.

Declaration
public void Add(Documents.Spreadsheet.RangeRef range, Documents.Spreadsheet.ICellValidator validator)
Parameters

GetErrorStyleForCellLink to this section

Gets the strictest DataValidationErrorStyle among failing validators for a cell. Plain ICellValidator instances default to Stop.

Declaration
public Documents.Spreadsheet.DataValidationErrorStyle GetErrorStyleForCell(Documents.Spreadsheet.CellRef cellRef)
Parameters
Type Name Description
Documents.Spreadsheet.CellRef cellRef
Returns

GetValidatorsLink to this section

Gets all validators for a specific range.

Declaration
public IReadOnlyList<Documents.Spreadsheet.ICellValidator> GetValidators(Documents.Spreadsheet.RangeRef range)
Parameters
Type Name Description
Documents.Spreadsheet.RangeRef range
Returns
Type Description
IReadOnlyList<Documents.Spreadsheet.ICellValidator>

GetValidatorsForCellLink to this section

Gets all validators that apply to a specific cell.

Declaration
public IReadOnlyList<Documents.Spreadsheet.ICellValidator> GetValidatorsForCell(Documents.Spreadsheet.CellRef cellRef)
Parameters
Type Name Description
Documents.Spreadsheet.CellRef cellRef
Returns
Type Description
IReadOnlyList<Documents.Spreadsheet.ICellValidator>

RemoveLink to this section

Removes a validation rule from a specific range.

Declaration
public bool Remove(Documents.Spreadsheet.RangeRef range, Documents.Spreadsheet.ICellValidator validator)
Parameters
Returns
Type Description
bool

RemoveAllLink to this section

Removes all validators for a specific range and returns them.

Declaration
public List<Documents.Spreadsheet.ICellValidator> RemoveAll(Documents.Spreadsheet.RangeRef range)
Parameters
Type Name Description
Documents.Spreadsheet.RangeRef range
Returns
Type Description
List<Documents.Spreadsheet.ICellValidator>

ValidateLink to this section

Validates the specified cell against all validation rules defined for its range in the spreadsheet.

Declaration
public IReadOnlyList<string> Validate(Documents.Spreadsheet.Cell cell)
Parameters
Type Name Description
Documents.Spreadsheet.Cell cell
Returns
Type Description
IReadOnlyList<string>
An error has occurred. This app may no longer respond until reloaded. Reload 🗙