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

Specifies whether users can enter custom values in the edit box of the ComboBox.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(false)]
[Parameter]
public bool AllowUserInput { get; set; }

#Property Value

Type Default Description
Boolean false

true to allow users to enter new values in the edit box; false to allow users only to select ComboBox values from the drop-down window.

#Remarks

Set this property to true to allow users to type custom values into the edit box of the ComboBox. The ComboBox editor does not add these values to the bound data source or a drop-down window. If a user enters a value equal to a drop-down window item, the editor selects the corresponding item.

To specify the text displayed in the edit box of the ComboBox, use the Text property. The following code snippet displays the current text and value of the ComboBox editor 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"
            @bind-Text="@Text" />

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

Run Demo: ComboBox - Allow User Input

Note

If you use the EditBoxDisplayTemplate property and need to allow user input, you should add a DxInputBox object to the template markup.

#Implements

DevExpress.Blazor.IComboBox<TData, TValue>.AllowUserInput
See Also