Skip to main content

BootstrapTagBoxValues<TKey> Class

Gets required TagBox values (predefined or custom tags) on the controller side and passes these values to the control.

Namespace: DevExpress.AspNetCore.Bootstrap

Assembly: DevExpress.AspNetCore.Bootstrap.v18.2.dll

Declaration

public class BootstrapTagBoxValues<TKey> :
    IBootstrapTagBoxValuesOwner

Type Parameters

Name Description
TKey

Type of a tag value’s field used in a TagBox control.

Remarks

IMPORTANT

Bootstrap Controls for ASP.NET Core are in maintenance mode. We don’t add new controls or develop new functionality for this product line. Our recommendation is to use the ASP.NET Core Controls suite.

Using the BootstrapTagBoxValues<TKey> class only makes sense once custom tags are activated in the Tag Box control. To do this, enable the AllowCustomTags property.

IMPORTANT

This class requires that the control not use the Loading items on demand feature. Otherwise, obtain tag box values via a List<string>-type model and manually detach predefined tags (which an end-user can select from a Tag Box drop-down list) from custom tags (which are not listed in the Tag Box control but manually entered by an end-user).

The BootstrapTagBoxValues<TKey> class provides you with the following features:

To bind a control to both custom tags and predefined tags, pass a model of the BootstrapTagBoxValues<TKey> type to the Tag Box control. The code below demonstrates this approach in detail.

 @model BootstrapTagBoxValues<int>

<form method="post">
    @(Html.DevExpress()
        .BootstrapTagBoxFor(m => m)
        .AllowCustomTags(true)
        .Items(items =>
        {
            items.Add()
              .Text("Item 1")
              .Value(1);
        }))
    <button type="submit" class="btn btn-primary">Submit</button>
</form>

For more information on the Tag Box control, refer to the Tag Box online demo.

Example

The following example demonstrates how to use the BootstrapTagBoxValues class with a Tag Box that allows custom tags.

BootstrapTagBox for ASP.NET Core - How to use the BootstrapTagBoxValues class

Implements

DevExpress.AspNetCore.Bootstrap.Internal.IBootstrapTagBoxValuesOwner

Inheritance

Object
BootstrapTagBoxValues<TKey>
See Also