Table of Contents

Class RadzenRegexValidator

Namespace
Radzen.Blazor
Assembly
Radzen.Blazor.dll

A validator component which matches a component value against a specified regular expression pattern. Must be placed inside a RadzenTemplateForm<TItem>

public class RadzenRegexValidator : ValidatorBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormValidator
Inheritance
RadzenRegexValidator
Implements
Inherited Members

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(); 
}

Constructors

RadzenRegexValidator()

public RadzenRegexValidator()

Properties

Pattern

Specifies the regular expression pattern which the component value should match in order to be valid.

[Parameter]
public string Pattern { get; set; }

Property Value

string

Text

Gets or sets the message displayed when the component is invalid. Set to "Value should match" by default.

[Parameter]
public override string Text { get; set; }

Property Value

string

Methods

Validate(IRadzenFormComponent)

protected override bool Validate(IRadzenFormComponent component)

Parameters

component IRadzenFormComponent

Returns

bool