A multi-line text input component for entering longer text content with configurable dimensions. RadzenTextArea provides a resizable textarea with data binding, validation, and automatic sizing options. Ideal for comments, descriptions, messages, or any content requiring multiple lines. Features configurable sizing via Rows (height) and Cols (width) properties, MaxLength to restrict input length, browser-resizable textarea, integration with Blazor EditContext for form validation, and two-way binding via @bind-Value. The Rows and Cols properties set the initial/minimum size, but users can often resize the textarea using the resize handle.
FormComponent<string>.SetParametersAsync
FormComponent<string>.GetValue
FormComponent<string>.OnContextMenu
FormComponent<string>.GetClassList
FormComponent<string>.FocusAsync
FormComponent<string>.TabIndex
FormComponent<string>.Placeholder
FormComponent<string>.Disabled
FormComponent<string>.EditContext
FormComponent<string>.ValueChanged
FormComponent<string>.HasValue
FormComponent<string>.FieldIdentifier
FormComponent<string>.ValueExpression
FormComponent<string>.FormFieldContext
FormComponent<string>.CurrentPlaceholder
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenTextArea : FormComponent<string>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponentBasic textarea:
<RadzenTextArea @bind-Value=@description Rows="5" Placeholder="Enter description..." />
Textarea with character limit:
<RadzenTextArea @bind-Value=@comment Rows="4" Cols="50" MaxLength="500" Placeholder="Enter your comment (max 500 characters)" />
Read-only textarea for display:
<RadzenTextArea Value=@savedContent Rows="10" ReadOnly="true" />A multi-line text input component for entering longer text content with configurable dimensions. RadzenTextArea provides a resizable textarea with data binding, validation, and automatic sizing options. Ideal for comments, descriptions, messages, or any content requiring multiple lines. Features configurable sizing via Rows (height) and Cols (width) properties, MaxLength to restrict input length, browser-resizable textarea, integration with Blazor EditContext for form validation, and two-way binding via @bind-Value. The Rows and Cols properties set the initial/minimum size, but users can often resize the textarea using the resize handle.
public RadzenTextArea()Gets or sets the number of visible text columns (width) in the textarea. This determines the initial width of the textarea based on average character width. In modern CSS layouts, setting an explicit width via Style property is often preferred.
public int Cols { get; set; }
| Type | Description |
|---|---|
| int | Gets or sets the number of visible text columns (width) in the textarea. This determines the initial width of the textarea based on average character width. In modern CSS layouts, setting an explicit width via Style property is often preferred. |
Gets or sets a value indicating whether the component should update the value immediately when the user types. Set to false by default.
public bool Immediate { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether the component should update the value immediately when the user types. Set to false by default. |
Gets or sets the maximum number of characters that can be entered in the textarea. When set, the browser prevents users from entering more characters than this limit.
public long? MaxLength { get; set; }
| Type | Description |
|---|---|
| long? | Gets or sets the maximum number of characters that can be entered in the textarea. When set, the browser prevents users from entering more characters than this limit. |
Gets or sets whether the textarea is read-only and cannot be edited by the user. When true, the textarea displays the value but prevents user input while still allowing selection and copying.
public bool ReadOnly { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether the textarea is read-only and cannot be edited by the user. When true, the textarea displays the value but prevents user input while still allowing selection and copying. |
Gets or sets the number of visible text rows (height) in the textarea. This determines the initial height of the textarea. Users may be able to resize it depending on browser and CSS settings.
public int Rows { get; set; }
| Type | Description |
|---|---|
| int | Gets or sets the number of visible text rows (height) in the textarea. This determines the initial height of the textarea. Users may be able to resize it depending on browser and CSS settings. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Handles the change event.
protected virtual Task OnChange(ChangeEventArgs args)
| Type | Name | Description |
|---|---|---|
| ChangeEventArgs | args | The ChangeEventArgs instance containing the event data. |
| Type | Description |
|---|---|
| Task |
Handles the set binding of the underlying HTML textarea element.
protected virtual Task SetValue(string value)
| Type | Name | Description |
|---|---|---|
| string | value | string containing the new value. |
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |