Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTextBox.TextChanged Event

Fires when a Text value changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<string> TextChanged { get; set; }

#Parameters

Type Description
String

A new Text value.

#Remarks

Use the TextChanged event to handle a text change. The following code snippet disables the Update Text button when a user removes the text and the Text Box loses focus:

Razor
<DxTextBox Text="Some text" TextChanged="@((newValue) => OnTextChanged(newValue))" />
<DxButton Enabled="@IsEnabled">Update Text</DxButton>

@code {
    bool IsEnabled = false;

    void OnTextChanged(string newValue) {
        if (string.IsNullOrEmpty(newValue)) {
            IsEnabled = false;
        } else IsEnabled = true;
    }
}

You can also use the BindValueMode property to specify how and when to update the Text Box editor’s text.

Watch Video: Blazor Text Box: Get Started

See Also