ListBox
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)
The ListBox is a graphical user interface component used to display a list of items. Users can select one or more items in the list using a checkbox or by keyboard selection. It supports sorting, grouping, reordering and drag and drop of items.
- C#
- VB.NET
public class ListBox : ej2Base
Public Class ListBox
Inherits ej2Base
Constructors
ListBox()
Constructs a new instance of the ListBox class.
Example:
The following example creates a list box and fills it through the Options object.
var listBox = new ListBox();
listBox.Options.dataSource = new[] { "Espresso", "Cappuccino", "Latte", "Americano" };
this.Controls.Add(listBox);
ListBox(options)
Constructs a new instance of the ListBox class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a list box bound to a list of objects that allows the user to select multiple items using check boxes.
var listBox = new ListBox(new
{
fields = new { text = "name", value = "id" },
selectionSettings = new { mode = "Multiple", showCheckbox = true },
dataSource = new[]
{
new { id = 1, name = "Reading" },
new { id = 2, name = "Cycling" },
new { id = 3, name = "Cooking" }
}
});
this.Controls.Add(listBox);