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

DxComboBox<TData, TValue>.TextChanged Event

Allows you to react to the ComboBox editor’s text 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

The new text.

#Remarks

The ComboBox editor updates the Text property value and raises the TextChanged event when a user performs one of the following actions:

  • Changes the editor’s text and removes focus from the ComboBox.
  • Changes the editor’s text and presses Enter.
  • Clicks the Clear button.
  • Selects an item from the ComboBox editor’s drop-down window.

The following code snippet displays the current text and value of the ComboBox above the editor:

Razor
<p class="mb-1">
    Selected item: <b>@(Value == null ? "null" : Value)</b>, Text = <b>@Text</b>
</p>

<DxComboBox Data="@Cities"
            AllowUserInput="true"
            @bind-Value="@Value"
            Text="@Text" 
            TextChanged="@OnTextChanged" />

@code {
    IEnumerable<string> Cities = new List<string>() { "London", "Berlin", "Paris", };
    string Value { get; set; } 
    string Text { get; set; } = "London";

    void OnTextChanged(string newValue) {
        Text = newValue;
    }
}
See Also