Skip to main content

ListBoxExtension.BindList(Object) Method

Binds an item list to the ListBox editor.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public ListBoxExtension BindList(
    object dataObject
)

Parameters

Name Type Description
dataObject Object

An object representing the bound data source.

Returns

Type Description
ListBoxExtension

A ListBoxExtension object representing the ListBox.

Remarks

Run Demo: List Box

Use the BindList(Object) method to bind the ListBox to an item list.

@Html.DevExpress().ListBox(settings => {
    settings.Name = "lbFeatures";
    settings.Width = 285;
    settings.Height = 210;
    settings.Properties.Caption = "Phone features:";
    settings.Properties.CaptionSettings.Position = EditorCaptionPosition.Top;
    settings.Properties.ValueField = "ID";
    settings.Properties.ValueType = typeof(string);
    settings.Properties.TextField = "Name";
}).BindList(Model).GetHtml()
See Also