Skip to main content

ejDropDownList

Namespace: Wisej.Web.Ext.Syncfusion

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

The DropDownList control provides a list of options to choose an item from the list. It can including other HTML elements such as images, textboxes, check box, radio buttons, and so on.

public class ejDropDownList : ejBase

Constructors​

Instance member ejDropDownList()​

Constructs a new instance of the ejDropDownList class.

Example:

The following example creates the drop down list and sets the items through the options.

var dropDown = new ejDropDownList();
dropDown.Options.dataSource = new[]
{
new { text = "Small", value = "S" },
new { text = "Medium", value = "M" },
new { text = "Large", value = "L" }
};
dropDown.Options.fields = new { text = "text", value = "value" };
dropDown.Options.watermarkText = "Select a size";
dropDown.Location = new Point(20, 20);
this.Controls.Add(dropDown);

Instance member ejDropDownList(options)​

Constructs a new instance of the ejDropDownList class.

NameTypeDescription
optionsObjectInitial set of options.

Example:

The following example binds the list to a collection of objects and shows a check box next to each item.

var dropDown = new ejDropDownList(new
{
dataSource = countries,
fields = new { text = "Name", value = "Code" },
watermarkText = "Select the countries",
showCheckbox = true
});
this.Controls.Add(dropDown);

Properties​

Instance member Text​

String: Defines the text value that is displayed in the DropDownList textbox. In case of MultiSelectMode, returns the selected item's texts and separated by delimiterChar in string type. (Default: "")

Assigning the property sets the text option of the widget in the browser, which selects the item with the specified text. The text of the items selected by the user in the browser is sent back to the server and returned by this property.

Example:

// select the item by its text.
this.dropDown1.Text = "Medium";

// read the text of the selected items, i.e. in the handler of a button.
var selected = this.dropDown1.Text.Split(',');

Methods​

Protected member OnWebUpdate(state)​

Processes changes between client and server.

ParameterTypeDescription
stateObject

Implements​