Class ValidatorBase
Base class of Radzen validator components.
public abstract class ValidatorBase : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormValidator
- Inheritance
-
ValidatorBase
- Implements
- Derived
- Inherited Members
Constructors
ValidatorBase()
protected ValidatorBase()
Fields
messages
Stores the validation messages.
protected ValidationMessageStore messages
Field Value
Properties
Component
Specifies the component which this validator should validate. Must be set to the Name of an existing component.
[Parameter]
public string Component { get; set; }
Property Value
EditContext
Provided by the RadzenTemplateForm<TItem> which contains this validator. Used internally.
[CascadingParameter]
public EditContext EditContext { get; set; }
Property Value
- EditContext
The edit context.
Form
Gets or sets the form which contains this validator.
[CascadingParameter]
public IRadzenForm Form { get; set; }
Property Value
IsValid
Returns the validity status.
public bool IsValid { get; protected set; }
Property Value
- bool
true
if this validator is valid; otherwise,false
.
Popup
Determines if the validator is displayed as a popup or not. Set to false
by default.
[Parameter]
public bool Popup { get; set; }
Property Value
Text
Specifies the message displayed when the validator is invalid.
[Parameter]
public abstract string Text { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder builder)
Parameters
builder
RenderTreeBuilder
Dispose()
public override void Dispose()
GetComponentCssClass()
protected override string GetComponentCssClass()
Returns
SetParametersAsync(ParameterView)
public override Task SetParametersAsync(ParameterView parameters)
Parameters
parameters
ParameterView
Returns
Validate(IRadzenFormComponent)
Runs validation against the specified component.
protected abstract bool Validate(IRadzenFormComponent component)
Parameters
component
IRadzenFormComponentThe component to validate.
Returns
- bool
true
if validation is successful,false
otherwise.