DropDownTree
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)
The Dropdown Tree control contains a hierarchical structure list of pre-defined values from that the user can choose a single value.
- C#
- VB.NET
public class DropDownTree : ej2Base
Public Class DropDownTree
Inherits ej2Base
Constructors
DropDownTree()
Constructs a new instance of the DropDownTree class.
Example:
The following example creates a drop-down tree and binds it to hierarchical data through the Options object.
var dropDownTree = new DropDownTree();
dropDownTree.Options.placeholder = "Select a country";
dropDownTree.Options.fields = new
{
value = "id",
text = "name",
child = "countries",
dataSource = new[]
{
new { id = "eu", name = "Europe", countries = new[] { new { id = "it", name = "Italy" }, new { id = "de", name = "Germany" } } },
new { id = "as", name = "Asia", countries = new[] { new { id = "jp", name = "Japan" }, new { id = "in", name = "India" } } }
}
};
this.Controls.Add(dropDownTree);
DropDownTree(options)
Constructs a new instance of the DropDownTree class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a drop-down tree with check boxes bound to self-referential data.
var dropDownTree = new DropDownTree(new
{
placeholder = "Select the departments",
showCheckBox = true,
fields = new
{
value = "id",
text = "name",
parentValue = "parentId",
hasChildren = "hasChild",
dataSource = new object[]
{
new { id = 1, name = "Engineering", hasChild = true },
new { id = 2, parentId = 1, name = "Development" },
new { id = 3, parentId = 1, name = "Quality Assurance" },
new { id = 4, name = "Sales" }
}
}
});
this.Controls.Add(dropDownTree);