Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenTextArea

    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
    IDisposable
    IRadzenFormComponent
    Inherited Members
    FormComponent<string>._value
    FormComponent<string>.SetParametersAsync(ParameterView)
    FormComponent<string>.Dispose()
    FormComponent<string>.GetValue()
    FormComponent<string>.OnContextMenu(MouseEventArgs)
    FormComponent<string>.GetClassList(string)
    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
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.GetCssClass()
    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.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.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenTextArea : FormComponent<string>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, 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

    RadzenTextArea()

    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()
    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" />

    Properties

    Cols

    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
    [Parameter]
    public int Cols { get; set; }
    Property Value
    Type Description
    int

    The number of columns. Default is 20.

    MaxLength

    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
    [Parameter]
    public long? MaxLength { get; set; }
    Property Value
    Type Description
    long?

    The maximum character length, or null for no limit. Default is null.

    ReadOnly

    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
    [Parameter]
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    bool

    true if the textarea is read-only; otherwise, false. Default is false.

    Rows

    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
    [Parameter]
    public int Rows { get; set; }
    Property Value
    Type Description
    int

    The number of rows. Default is 2.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    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
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    GetComponentCssClass()

    Gets the component CSS class.

    Declaration
    protected override string GetComponentCssClass()
    Returns
    Type Description
    string
    Overrides
    RadzenComponent.GetComponentCssClass()

    GetId()

    Gets the unique identifier.

    Declaration
    protected override string GetId()
    Returns
    Type Description
    string

    Returns the id attribute (if specified) or generates a random one.

    Overrides
    RadzenComponent.GetId()

    OnChange(ChangeEventArgs)

    Handles the Change event.

    Declaration
    protected Task OnChange(ChangeEventArgs args)
    Parameters
    Type Name Description
    ChangeEventArgs args

    The ChangeEventArgs instance containing the event data.

    Returns
    Type Description
    Task

    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