Skip to main content

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.

public class dxLookup : dxBase

Constructors​

Instance member 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);

Instance member dxLookup(options)​

Constructs a new instance of the dxLookup class.

NameTypeDescription
optionsObjectInitial 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);

Implements​