Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenLengthValidator

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

    Inheritance
    System.Object
    RadzenComponent
    ValidatorBase
    RadzenLengthValidator
    Implements
    IDisposable
    IRadzenFormValidator
    Inherited Members
    ValidatorBase.Form
    ValidatorBase.Component
    ValidatorBase.Popup
    ValidatorBase.IsValid
    ValidatorBase.EditContext
    ValidatorBase.messages
    ValidatorBase.SetParametersAsync(ParameterView)
    ValidatorBase.GetComponentCssClass()
    ValidatorBase.Dispose()
    ValidatorBase.BuildRenderTree(RenderTreeBuilder)
    RadzenComponent.Attributes
    RadzenComponent.Element
    RadzenComponent.MouseEnter
    RadzenComponent.MouseLeave
    RadzenComponent.ContextMenu
    RadzenComponent.Culture
    RadzenComponent.DefaultCulture
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.OnContextMenu(Microsoft.AspNetCore.Components.Web.MouseEventArgs)
    RadzenComponent.Style
    RadzenComponent.Visible
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.Debounce(Func<Task>, Int32)
    RadzenComponent.UniqueID
    RadzenComponent.JSRuntime
    RadzenComponent.IsJSRuntimeAvailable
    RadzenComponent.OnInitialized()
    RadzenComponent.Reference
    RadzenComponent.OnAfterRenderAsync(Boolean)
    RadzenComponent.RaiseContextMenu(Microsoft.AspNetCore.Components.Web.MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.RaiseMouseLeave()
    RadzenComponent.CurrentStyle
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenLengthValidator : ValidatorBase, IDisposable, IRadzenFormValidator
    Examples
    <RadzenTemplateForm TItem="Model" Data=@model>
       <RadzenTextBox style="display: block" Name="FirstName" @bind-Value=@model.FirstName />
       <RadzenLengthValidator Component="FirstName" Min="3" Text="First name should be at least 3 characters" Style="position: absolute" />
    </RadzenTemplateForm>
    @code {
       class Model
       {
          public string FirstName { get; set; }
       }
       Model model = new Model(); 
    }

    Properties

    Max

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

    Declaration
    public int? Max { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    Min

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

    Declaration
    public int? Min { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    Text

    Gets or sets the message displayed when the component is invalid. Set to "Invalid length" by default.

    Declaration
    public override string Text { get; set; }
    Property Value
    Type Description
    System.String
    Overrides
    ValidatorBase.Text

    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

    true if validation is successful, false otherwise.

    Overrides
    ValidatorBase.Validate(IRadzenFormComponent)

    Implements

    IDisposable
    IRadzenFormValidator

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT