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

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

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

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

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

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

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

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

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

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

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 🗙