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

DxTagBox<TData, TValue>.AllowCustomTags Property

Specifies whether users are allowed to input custom tags that are not stored in a bound data source in a TagBox editor.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

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

#Property Value

Type Default Description
Boolean false

true if users can type custom tags or false if users can only select predefined tags from the drop-down window.

#Remarks

The TagBox’s tag list is populated dynamically through data binding. To allow users select predefined tags from the drop-down window and type custom tags in the editor box, set the AllowCustomTags property to true.

razor
<DxTagBox Data="@Cities"
          NullText="Select city..."
          TData="string"
          TValue="string"
          AllowCustomTags="true"
          @bind-Tags="@Tags"
          ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"/>

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

TagBox Custom Tags

To create a custom tag, users should type a value in the edit box and perform one of the following actions:

  • Press Enter or Tab
  • Remove focus from the edit box.

Run Demo: TagBox - Custom Tags

#Implements

DevExpress.Blazor.ITagBox<TData, TValue>.AllowCustomTags
See Also