Back to Devexpress

ListBoxExtension.BindList(Object) Method

aspnetmvc-devexpress-dot-web-dot-mvc-dot-listboxextension-dot-bindlist-x28-system-dot-object-x29.md

latest2.0 KB
Original Source

ListBoxExtension.BindList(Object) Method

Binds an item list to the ListBox editor.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v25.2.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public ListBoxExtension BindList(
    object dataObject
)
vb
Public Function BindList(
    dataObject As Object
) As ListBoxExtension

Parameters

NameTypeDescription
dataObjectObject

An object representing the bound data source.

|

Returns

TypeDescription
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.

cshtml
@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

ListBox

ListBoxExtension Class

ListBoxExtension Members

DevExpress.Web.Mvc Namespace