Skip to main content

ListBoxExtension Class

Represents an extension object implementing the ListBox functionality.

Namespace: DevExpress.Web.Mvc

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

Declaration

public class ListBoxExtension :
    EditorExtension

Remarks

To declare the ListBox in a View, invoke the ExtensionsFactory.ListBox helper method. This method returns the ListBox extension that is implemented by the ListBoxExtension class.

To configure the ListBox extension, pass the ListBoxSettings object to the ExtensionsFactory.ListBox helper method as a parameter. The ListBoxSettings object contains all the ListBox extension settings.

Refer to the ListBox Overview topic to learn how to add the ListBox extension to your project.

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()

Inheritance

See Also