ValidatorBase Class

Base class of Radzen validator components.

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormValidator

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public abstract class ValidatorBase : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormValidator

Constructors

ValidatorBaselink

Base class of Radzen validator components.

Declaration
protected ValidatorBase()

Fields

messageslink

Stores the validation messages.

Declaration
protected Forms.ValidationMessageStore messages

Properties

Componentlink

Specifies the component which this validator should validate. Must be set to the Name of an existing component.

Declaration
public string Component { get; set; }
Property Value
Type Description
stringSpecifies the component which this validator should validate. Must be set to the Name of an existing component.

EditContextlink

Provided by the RadzenTemplateForm<T> which contains this validator. Used internally.

Declaration
public Forms.EditContext EditContext { get; set; }
Property Value
Type Description
Forms.EditContextProvided by the RadzenTemplateForm<T> which contains this validator. Used internally.

Formlink

Gets or sets the form which contains this validator.

Declaration
public IRadzenForm Form { get; set; }
Property Value
Type Description
IRadzenFormGets or sets the form which contains this validator.

IsValidlink

Returns the validity status.

Declaration
public bool IsValid { get; set; }
Property Value
Type Description
boolReturns the validity status.

Popuplink

Determines if the validator is displayed as a popup or not. Set to false by default.

Declaration
public bool Popup { get; set; }
Property Value
Type Description
boolDetermines if the validator is displayed as a popup or not. Set to false by default.

Textlink

Specifies the message displayed when the validator is invalid.

Declaration
public string Text { get; set; }
Property Value
Type Description
stringSpecifies the message displayed when the validator is invalid.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder builder

Disposelink

Declaration
public override void Dispose()

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

SetParametersAsynclink

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task

Validatelink

Runs validation against the specified component.

Declaration
protected abstract bool Validate(IRadzenFormComponent component)
Parameters
Type Name Description
IRadzenFormComponent component The component to validate.
Returns
Type Description
booltrue if validation is successful, false otherwise.
An error has occurred. This app may no longer respond until reloaded. Reload 🗙