Skip to main content

ejComboBox

Namespace: Wisej.Web.Ext.Syncfusion

Assembly: Wisej.Web.Ext.Syncfusion (4.1.0.0)

The ComboBox control allows the user to type a value or to choose an option from a list of predefined options.

public class ejComboBox : ejBase

Constructors​

Instance member ejComboBox()​

Constructs a new instance of the ejComboBox class.

Example:

The following example creates the combo box and sets the list of options through the options.

var comboBox = new ejComboBox();
comboBox.Options.dataSource = new[] { "Small", "Medium", "Large" };
comboBox.Options.placeholder = "Select a size";
comboBox.Location = new Point(20, 20);
this.Controls.Add(comboBox);

Instance member ejComboBox(options)​

Constructs a new instance of the ejComboBox class.

NameTypeDescription
optionsObjectInitial set of options.

Example:

The following example binds the list to a collection of objects.

var comboBox = new ejComboBox(new
{
dataSource = countries,
fields = new { text = "Name", value = "Code" },
placeholder = "Select a country"
});
this.Controls.Add(comboBox);

Properties​

Instance member Text​

String: Gets or sets the text for the ejComboBox. (Default: "")

The property reads and writes the value option of the widget and raises the TextChanged event every time it is assigned. It is not updated when the user changes the selection in the browser: handle the change event of the widget to receive the value selected by the user.

Example:

// select the item with the specified value.
this.comboBox1.Text = "IT";

// receive the value selected by the user.
this.comboBox1.Instance.onChange += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"Selected value: {e.Data.value}");
});

Implements​