RadzenTextArea Class

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.

Inheritance

Object

ComponentBase

RadzenComponent

FormComponent<string>

RadzenTextArea

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Inherited Members

FormComponent<string>.SetParametersAsync

FormComponent<string>.Dispose

FormComponent<string>.GetValue

FormComponent<string>.OnContextMenu

FormComponent<string>.GetClassList

FormComponent<string>.FocusAsync

FormComponent<string>.Name

FormComponent<string>.TabIndex

FormComponent<string>.Placeholder

FormComponent<string>.Disabled

FormComponent<string>.EditContext

FormComponent<string>.Form

FormComponent<string>.ValueChanged

FormComponent<string>.HasValue

FormComponent<string>.IsBound

FormComponent<string>.Value

FormComponent<string>.Change

FormComponent<string>.FieldIdentifier

FormComponent<string>.ValueExpression

FormComponent<string>.FormFieldContext

FormComponent<string>.CurrentPlaceholder

FormComponent<string>._value

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.Debounce

RadzenComponent.OnInitialized

RadzenComponent.OnAfterRenderAsync

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

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.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

Syntax

public class RadzenTextArea : FormComponent<string>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent

Examples

Basic 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" />

Constructors

RadzenTextArealink

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.

Declaration
public RadzenTextArea()

Properties

Colslink

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.

Declaration
public int Cols { get; set; }
Property Value
Type Description
intGets 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.

Immediatelink

Gets or sets a value indicating whether the component should update the value immediately when the user types. Set to false by default.

Declaration
public bool Immediate { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether the component should update the value immediately when the user types. Set to false by default.

MaxLengthlink

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.

Declaration
public long? MaxLength { get; set; }
Property Value
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.

ReadOnlylink

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.

Declaration
public bool ReadOnly { get; set; }
Property Value
Type Description
boolGets 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.

Rowslink

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.

Declaration
public int Rows { get; set; }
Property Value
Type Description
intGets 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.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

GetIdlink

Declaration
protected override string GetId()
Returns
Type Description
string

OnChangelink

Handles the change event.

Declaration
protected virtual Task OnChange(ChangeEventArgs args)
Parameters
Type Name Description
ChangeEventArgs args The ChangeEventArgs instance containing the event data.
Returns
Type Description
Task

SetValuelink

Handles the set binding of the underlying HTML textarea element.

Declaration
protected virtual Task SetValue(string value)
Parameters
Type Name Description
string value string containing the new value.
Returns
Type Description
TaskA task representing the asynchronous operation.
An error has occurred. This app may no longer respond until reloaded. Reload 🗙