ListBoxSettings Class
Contains the ListBox extension settings.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.2.dll
Declaration
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.
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()