DropDownList
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)
The DropDownList component contains a list of predefined values from that the user can choose a single value.
- C#
- VB.NET
public class DropDownList : ej2Base
Public Class DropDownList
Inherits ej2Base
Constructors
DropDownList()
Constructs a new instance of the DropDownList class.
Example:
The following example creates a drop-down list and fills it through the Options object.
var dropDownList = new DropDownList();
dropDownList.Options.placeholder = "Select a country";
dropDownList.Options.dataSource = new[] { "France", "Germany", "Italy" };
this.Controls.Add(dropDownList);
DropDownList(options)
Constructs a new instance of the DropDownList class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a drop-down list bound to a list of objects and handles the change event on the server.
var dropDownList = new DropDownList(new
{
placeholder = "Select a customer",
allowFiltering = true,
fields = new { text = "name", value = "id" },
dataSource = new[]
{
new { id = 1, name = "Alfreds Futterkiste" },
new { id = 2, name = "Around the Horn" },
new { id = 3, name = "Bottom-Dollar Markets" }
}
});
dropDownList.Instance.onChange += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"Selected customer {e.Data.value}");
});
this.Controls.Add(dropDownList);