Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class FormComponent<T>

    Base class for all Radzen form input components providing data binding, validation, and change event capabilities. FormComponent integrates with Blazor's EditContext for form validation and provides common functionality for all input controls. This is the base class for components like RadzenTextBox, RadzenCheckBox, RadzenDropDown, RadzenDatePicker, etc. Provides @bind-Value support for two-way binding, integration with Blazor EditContext and validators, Change and ValueChanged callbacks, Disable property to prevent user interaction, Placeholder text for empty inputs, Name property for validation and label association, and TabIndex for keyboard navigation control. Components inheriting from FormComponent automatically work with RadzenTemplateForm and validators.

    Inheritance
    object
    ComponentBase
    RadzenComponent
    FormComponent<T>
    RadzenCheckBoxList<TValue>
    RadzenCheckBox<TValue>
    RadzenColorPicker
    RadzenFileInput<TValue>
    RadzenHtmlEditor
    RadzenRadioButtonList<TValue>
    RadzenRating
    RadzenSecurityCode
    RadzenSelectBar<TValue>
    RadzenSlider<TValue>
    RadzenSwitch
    RadzenTextArea
    FormComponentWithAutoComplete<T>
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    IRadzenFormComponent
    Inherited Members
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.GetComponentCssClass()
    RadzenComponent.Debounce(Func<Task>, int)
    RadzenComponent.OnInitialized()
    RadzenComponent.OnAfterRenderAsync(bool)
    RadzenComponent.RaiseContextMenu(MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.AddContextMenu()
    RadzenComponent.RaiseMouseLeave()
    RadzenComponent.Attributes
    RadzenComponent.Element
    RadzenComponent.MouseEnter
    RadzenComponent.MouseLeave
    RadzenComponent.ContextMenu
    RadzenComponent.Culture
    RadzenComponent.DefaultCulture
    RadzenComponent.Style
    RadzenComponent.Visible
    RadzenComponent.UniqueID
    RadzenComponent.JSRuntime
    RadzenComponent.IsJSRuntimeAvailable
    RadzenComponent.Reference
    RadzenComponent.CurrentStyle
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.StateHasChanged()
    ComponentBase.ShouldRender()
    ComponentBase.OnAfterRender(bool)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.DispatchExceptionAsync(Exception)
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Radzen
    Assembly: Radzen.Blazor.dll
    Syntax
    public class FormComponent<T> : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormComponent
    Type Parameters
    Name Description
    T

    The type of the component's bound value (string, int, DateTime, etc.).

    Constructors

    FormComponent()

    Base class for all Radzen form input components providing data binding, validation, and change event capabilities. FormComponent integrates with Blazor's EditContext for form validation and provides common functionality for all input controls. This is the base class for components like RadzenTextBox, RadzenCheckBox, RadzenDropDown, RadzenDatePicker, etc. Provides @bind-Value support for two-way binding, integration with Blazor EditContext and validators, Change and ValueChanged callbacks, Disable property to prevent user interaction, Placeholder text for empty inputs, Name property for validation and label association, and TabIndex for keyboard navigation control. Components inheriting from FormComponent automatically work with RadzenTemplateForm and validators.

    Declaration
    public FormComponent()

    Fields

    _value

    The value

    Declaration
    protected T _value
    Field Value
    Type Description
    T

    Properties

    Change

    Gets or sets the change.

    Declaration
    [Parameter]
    public EventCallback<T> Change { get; set; }
    Property Value
    Type Description
    EventCallback<T>

    The change.

    CurrentPlaceholder

    Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField.

    Declaration
    protected string CurrentPlaceholder { get; }
    Property Value
    Type Description
    string

    Disabled

    Gets or sets a value indicating whether this FormComponent<T> is disabled.

    Declaration
    [Parameter]
    public bool Disabled { get; set; }
    Property Value
    Type Description
    bool

    true if disabled; otherwise, false.

    EditContext

    Gets or sets the edit context.

    Declaration
    [CascadingParameter]
    public EditContext EditContext { get; set; }
    Property Value
    Type Description
    EditContext

    The edit context.

    FieldIdentifier

    Gets the field identifier.

    Declaration
    [Parameter]
    public FieldIdentifier FieldIdentifier { get; set; }
    Property Value
    Type Description
    FieldIdentifier

    The field identifier.

    Form

    Gets or sets the form.

    Declaration
    [CascadingParameter]
    public IRadzenForm Form { get; set; }
    Property Value
    Type Description
    IRadzenForm

    The form.

    FormFieldContext

    Provides support for RadzenFormField integration.

    Declaration
    [CascadingParameter]
    public IFormFieldContext FormFieldContext { get; set; }
    Property Value
    Type Description
    IFormFieldContext

    HasValue

    Gets a value indicating whether this instance has value.

    Declaration
    public virtual bool HasValue { get; }
    Property Value
    Type Description
    bool

    true if this instance has value; otherwise, false.

    IsBound

    Gets a value indicating whether this instance is bound.

    Declaration
    public bool IsBound { get; }
    Property Value
    Type Description
    bool

    true if this instance is bound; otherwise, false.

    Name

    Gets or sets the unique name identifier for this form component. Used for validation association (linking with validators and labels) and for identifying the field in form submission. This name should be unique within the form and match the Component property of associated validators/labels.

    Declaration
    [Parameter]
    public string Name { get; set; }
    Property Value
    Type Description
    string

    The component name.

    Placeholder

    Gets or sets the placeholder.

    Declaration
    [Parameter]
    public string Placeholder { get; set; }
    Property Value
    Type Description
    string

    The placeholder.

    TabIndex

    Gets or sets the tab order index for keyboard navigation. Controls the order in which fields receive focus when the user presses the Tab key. Lower values receive focus first. Use -1 to exclude from tab navigation.

    Declaration
    [Parameter]
    public int TabIndex { get; set; }
    Property Value
    Type Description
    int

    The tab index. Default is 0 (natural tab order).

    Value

    Gets or sets the value.

    Declaration
    [Parameter]
    public virtual T Value { get; set; }
    Property Value
    Type Description
    T

    The value.

    ValueChanged

    Gets or sets the value changed.

    Declaration
    [Parameter]
    public EventCallback<T> ValueChanged { get; set; }
    Property Value
    Type Description
    EventCallback<T>

    The value changed.

    ValueExpression

    Gets or sets the value expression.

    Declaration
    [Parameter]
    public Expression<Func<T>> ValueExpression { get; set; }
    Property Value
    Type Description
    Expression<Func<T>>

    The value expression.

    Methods

    Dispose()

    Disposes this instance.

    Declaration
    public override void Dispose()
    Overrides
    RadzenComponent.Dispose()

    FocusAsync()

    Sets the focus.

    Declaration
    public virtual ValueTask FocusAsync()
    Returns
    Type Description
    ValueTask

    GetClassList(string)

    Gets the class list.

    Declaration
    protected ClassList GetClassList(string className)
    Parameters
    Type Name Description
    string className

    Name of the class.

    Returns
    Type Description
    ClassList

    ClassList.

    GetValue()

    Gets the value.

    Declaration
    public object GetValue()
    Returns
    Type Description
    object

    System.Object.

    OnContextMenu(MouseEventArgs)

    Handles the ContextMenu event.

    Declaration
    public override Task OnContextMenu(MouseEventArgs args)
    Parameters
    Type Name Description
    MouseEventArgs args

    The MouseEventArgs instance containing the event data.

    Returns
    Type Description
    Task

    Task.

    Overrides
    RadzenComponent.OnContextMenu(MouseEventArgs)

    SetParametersAsync(ParameterView)

    Sets the parameters asynchronous.

    Declaration
    public override Task SetParametersAsync(ParameterView parameters)
    Parameters
    Type Name Description
    ParameterView parameters

    The parameters.

    Returns
    Type Description
    Task

    Task.

    Overrides
    RadzenComponent.SetParametersAsync(ParameterView)

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    IRadzenFormComponent

    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