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
#Type Parameters
Name | Description |
---|---|
TKey | Type of a tag value’s field used in a Tag |
#Remarks
IMPORTANT
Bootstrap Controls for ASP.
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
The BootstrapTagBoxValues<TKey>
class provides you with the following features:
The TagValues property - access to predefined tags.
The CustomTagTexts property - access to custom tags.
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
BootstrapTagBox for ASP.NET Core - How to use the BootstrapTagBoxValues class