Table of Contents

Class RadzenNumericRangeValidator

Namespace
Radzen.Blazor
Assembly
Radzen.Blazor.dll

A validator component which checks if a component value is within a specified range. Must be placed inside a RadzenTemplateForm<TItem>

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

Examples

<RadzenTemplateForm TItem="Model" Data=@model>
   <RadzenNumeric style="display: block" Name="Quantity" @bind-Value=@model.Quantity />
   <RadzenNumericRangeValidator Component="Quantity" Min="1" Max="10" Text="Quantity should be between 1 and 10" Style="position: absolute" />
</RadzenTemplateForm>
@code {
   class Model
   {
      public decimal Quantity { get; set; }
   }
   Model model = new Model();
}

Constructors

RadzenNumericRangeValidator()

public RadzenNumericRangeValidator()

Properties

Max

Specifies the maximum value. The component value should be less than the maximum in order to be valid.

[Parameter]
public IComparable Max { get; set; }

Property Value

IComparable

Min

Specifies the minimum value. The component value should be greater than the minimum in order to be valid.

[Parameter]
public IComparable Min { get; set; }

Property Value

IComparable

Text

Gets or sets the message displayed when the component is invalid. Set to "Not in the valid range" 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