dxLookup
Namespace: Wisej.Web.Ext.DevExtreme
Assembly: Wisej.Web.Ext.DevExtreme (4.1.0.0)
The Lookup is a widget that allows an end user to search for an item in a collection shown in a drop-down menu.
- C#
- VB.NET
public class dxLookup : dxBase
Public Class dxLookup
Inherits dxBase
Constructors
dxLookup()
Constructs a new instance of the dxLookup class.
Example:
The following example creates a lookup with a list of countries and shows the value selected by the user.
var lookup = new dxLookup();
lookup.Options.dataSource = new[] { "Germany", "Italy", "Spain", "United States" };
lookup.Options.placeholder = "Select a country";
lookup.Options.searchEnabled = true;
lookup.Instance.onValueChanged += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"Country: {e.Data.value}");
});
lookup.Size = new Size(240, 36);
this.Controls.Add(lookup);
dxLookup(options)
Constructs a new instance of the dxLookup class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a lookup bound to a list of objects that displays the name and stores the id of the selected item.
var lookup = new dxLookup(new
{
dataSource = new[]
{
new { id = 1, name = "John Heart" },
new { id = 2, name = "Olivia Peyton" }
},
valueExpr = "id",
displayExpr = "name",
value = 2
});
lookup.Size = new Size(240, 36);
this.Controls.Add(lookup);