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.
- C#
- VB.NET
public class ejComboBox : ejBase
Public Class ejComboBox
Inherits ejBase
Constructors
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);
ejComboBox(options)
Constructs a new instance of the ejComboBox class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial 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
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}");
});