Class ValidatorBase
Base class of Radzen validator components.
Inheritance
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public abstract class ValidatorBase : RadzenComponent, IDisposable, IRadzenFormValidator
Fields
messages
Stores the validation messages.
Declaration
protected ValidationMessageStore messages
Field Value
Type | Description |
---|---|
ValidationMessageStore |
Properties
Component
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 |
---|---|
System.String |
EditContext
Provided by the RadzenTemplateForm<TItem> which contains this validator. Used internally.
Declaration
public EditContext EditContext { get; set; }
Property Value
Type | Description |
---|---|
EditContext | The edit context. |
Form
Gets or sets the form which contains this validator.
Declaration
public IRadzenForm Form { get; set; }
Property Value
Type | Description |
---|---|
IRadzenForm |
IsValid
Returns the validity status.
Declaration
public bool IsValid { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Popup
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 |
---|---|
System.Boolean |
Text
Specifies the message displayed when the validator is invalid.
Declaration
public abstract string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
RenderTreeBuilder | builder |
Dispose()
Detaches event handlers and disposes Reference.
Declaration
public override void Dispose()
Overrides
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
Type | Description |
---|---|
System.String |
Overrides
SetParametersAsync(ParameterView)
Called by the Blazor runtime when parameters are set.
Declaration
public override async Task SetParametersAsync(ParameterView parameters)
Parameters
Type | Name | Description |
---|---|---|
ParameterView | parameters | The parameters. |
Returns
Type | Description |
---|---|
Task |
Overrides
Validate(IRadzenFormComponent)
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 |
---|---|
System.Boolean |
|