BuilderFactoryExtensions.BootstrapListBox(BuilderFactory, String) Method

Creates a List Box control with a specified name.

Namespace: DevExpress.AspNetCore

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

Declaration

public static BootstrapListBoxBuilder BootstrapListBox(
    this BuilderFactory builderFactory,
    string name
)
<ExtensionAttribute>
Public Shared Function BootstrapListBox(
    builderFactory As BuilderFactory,
    name As String
) As BootstrapListBoxBuilder

Parameters

Type Name Description
BuilderFactory builderFactory

A BuilderFactory object providing access to List Box settings.

String name

A control name.

Returns

Type Description
BootstrapListBoxBuilder

A builder for a List Box control.

The code sample below demonstrates how you can use this method to create a List Box control.

@(Html.DevExpress()
    .BootstrapListBox("listBoxDefault")
    .Value("Item1")
    .Items(items => {
        items.Add()
            .Text("Item1")
            .Value("Item1");
        items.Add()
            .Text("Item2")
            .Value("Item2");
        items.Add()
            .Text("Item3")
            .Value("Item3");
        items.Add()
            .Text("Item4")
            .Value("Item4");
        items.Add()
            .Text("Item5")
            .Value("Item5");
    })
)

See Also