Class RadzenRegexValidator
A validator component which matches a component value against a specified regular expression pattern. Must be placed inside a RadzenTemplateForm<TItem>
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenRegexValidator : ValidatorBase, IDisposable, IRadzenFormValidator
Examples
<RadzenTemplateForm TItem="Model" Data=@model>
<RadzenTextBox style="display: block" Name="ZIP" @bind-Value=@model.Zip />
<RadzenRegexValidator Component="ZIP" Text="ZIP code must be 5 digits" Pattern="\d{5}" Style="position: absolute" />
</RadzenTemplateForm>
@code {
class Model
{
public string Zip { get; set; }
}
Model model = new Model();
}
Properties
Pattern
Specifies the regular expression pattern which the component value should match in order to be valid.
Declaration
public string Pattern { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Text
Gets or sets the message displayed when the component is invalid. Set to "Value should match"
by default.
Declaration
public override string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Methods
Validate(IRadzenFormComponent)
Runs validation against the specified component.
Declaration
protected override bool Validate(IRadzenFormComponent component)
Parameters
Type | Name | Description |
---|---|---|
IRadzenFormComponent | component | The component to validate. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Implements
IDisposable