Back to Devexpress

DxTextBox.TextChanged Event

blazor-devexpress-dot-blazor-dot-dxtextbox-93cbd10a.md

latest1.6 KB
Original Source

DxTextBox.TextChanged Event

Fires after the editor text changed.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Parameters

TypeDescription
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;
    }
}

YouTube video

BindValueModeSpecifies when to update the Text Box editor’s text.TextChangingFires when a user is changing text in the editor. Use this event to validate/cancel user input. See Also

DxTextBox Class

DxTextBox Members

DevExpress.Blazor Namespace