Back to Devexpress

ListBoxSettings Class

aspnetmvc-devexpress-dot-web-dot-mvc-60472507.md

latest3.1 KB
Original Source

ListBoxSettings Class

Contains the ListBox extension settings.

Namespace : DevExpress.Web.Mvc

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

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public class ListBoxSettings :
    EditorSettings
vb
Public Class ListBoxSettings
    Inherits EditorSettings

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.

To access the ListBox specific settings, refer to the ListBoxSettings.Properties property.

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

Inheritance

Object SettingsBase EditorSettings ListBoxSettings

See Also

ListBoxSettings Members

ListBox

ListBoxExtension

DevExpress.Web.Mvc Namespace