Class RadzenNumericRangeValidator
A validator component which checks if a component value is within a specified range. Must be placed inside a RadzenTemplateForm<TItem>
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenNumericRangeValidator : ValidatorBase, IDisposable, IRadzenFormValidator
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();
}
Properties
AllowNull
Specifies if value can be null. If true, a null component value will be accepted.
Declaration
public bool AllowNull { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Max
Specifies the maximum value. The component value should be less than the maximum in order to be valid.
Declaration
public IComparable Max { get; set; }
Property Value
Type | Description |
---|---|
IComparable |
Min
Specifies the minimum value. The component value should be greater than the minimum in order to be valid.
Declaration
public IComparable Min { get; set; }
Property Value
Type | Description |
---|---|
IComparable |
Text
Gets or sets the message displayed when the component is invalid. Set to "Not in the valid range"
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 |
|