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.
RadzenComponent.GetComponentCssClass
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.BuildRenderTree
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen
Assembly: Radzen.Blazor.dll
public class FormComponent<T> : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent| Name | Description |
|---|---|
| T | The type of the component's bound value (string, int, DateTime, etc.). |
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.
public FormComponent<T>()Gets or sets the change.
public EventCallback<T> Change { get; set; }
| Type | Description |
|---|---|
| EventCallback<T> | Gets or sets the change. |
Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField.
protected string CurrentPlaceholder { get; }
| Type | Description |
|---|---|
| string | Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField. |
Gets or sets a value indicating whether this FormComponent<T> is disabled.
public bool Disabled { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether this FormComponent<T> is disabled. |
Gets or sets the edit context.
public Forms.EditContext EditContext { get; set; }
| Type | Description |
|---|---|
| Forms.EditContext | Gets or sets the edit context. |
Gets the field identifier.
public Forms.FieldIdentifier FieldIdentifier { get; set; }
| Type | Description |
|---|---|
| Forms.FieldIdentifier | Gets the field identifier. |
Gets or sets the form.
public IRadzenForm Form { get; set; }
| Type | Description |
|---|---|
| IRadzenForm | Gets or sets the form. |
Provides support for RadzenFormField integration.
public IFormFieldContext FormFieldContext { get; set; }
| Type | Description |
|---|---|
| IFormFieldContext | Provides support for RadzenFormField integration. |
Gets a value indicating whether this instance has value.
public bool HasValue { get; }
| Type | Description |
|---|---|
| bool | Gets a value indicating whether this instance has value. |
Gets a value indicating whether this instance is bound.
public bool IsBound { get; }
| Type | Description |
|---|---|
| bool | Gets a value indicating whether this instance is bound. |
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.
public string Name { get; set; }
| Type | Description |
|---|---|
| string | 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. |
Gets or sets the placeholder.
public string Placeholder { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the placeholder. |
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.
public int TabIndex { get; set; }
| Type | Description |
|---|---|
| int | 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. |
Gets or sets the value.
public T Value { get; set; }
| Type | Description |
|---|---|
| T | Gets or sets the value. |
Gets or sets the value changed.
public EventCallback<T> ValueChanged { get; set; }
| Type | Description |
|---|---|
| EventCallback<T> | Gets or sets the value changed. |
Gets or sets the value expression.
public Expressions.Expression<Func<T>> ValueExpression { get; set; }
| Type | Description |
|---|---|
| Expressions.Expression<Func<T>> | Gets or sets the value expression. |
Gets the class list.
protected Rendering.ClassList GetClassList(string className)
| Type | Name | Description |
|---|---|---|
| string | className | Name of the class. |
| Type | Description |
|---|---|
| Rendering.ClassList | ClassList. |
Gets the value.
public object GetValue()
| Type | Description |
|---|---|
| object | System.Object. |
Handles the ContextMenu event.
public override Task OnContextMenu(MouseEventArgs args)
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | args | The MouseEventArgs instance containing the event data. |
| Type | Description |
|---|---|
| Task | Task. |
Sets the parameters asynchronous.
public override Task SetParametersAsync(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters | The parameters. |
| Type | Description |
|---|---|
| Task | Task. |