Class TreeView
Inheritance
System.Object
TreeView
Assembly: Syncfusion.EJ2.dll
Syntax
public class TreeView : EJTagHelper
Constructors
TreeView()
Declaration
Properties
ActionFailure
Triggers when any TreeView action failed to fetch the desired results.
Declaration
public string ActionFailure { get; set; }
Property Value
Type |
Description |
System.String |
|
AllowDragAndDrop
Indicates whether the TreeView allows drag and drop of nodes. To drag and drop a node in
desktop, hold the mouse on the node, drag it to the target node and drop the node by releasing
the mouse. For touch devices, drag and drop operation is performed by touch, touch move
and touch end. For more information on drag and drop nodes concept, refer to
Drag and Drop.
Declaration
public bool AllowDragAndDrop { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
AllowEditing
Enables or disables editing of the text in the TreeView node. When allowEditing
property is set
to true, the TreeView allows you to edit the node by double clicking the node or by navigating to
the node and pressing F2 key. For more information on node editing, refer
to Node Editing.
Declaration
public bool AllowEditing { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
AllowMultiSelection
Enables or disables multi-selection of nodes. To select multiple nodes:
Select the nodes by holding down the CTRL key while clicking on the nodes.
Select consecutive nodes by clicking the first node to select and hold down the SHIFT key
and click the last node to select.
Declaration
public bool AllowMultiSelection { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Animation
Specifies the type of animation applied on expanding and collapsing the nodes along with duration.
Declaration
public TreeViewNodeAnimationSettings Animation { get; set; }
Property Value
AutoCheck
Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node.
Declaration
public bool AutoCheck { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
CheckedNodes
The checkedNodes
property is used to set the nodes that need to be checked or
get the ID of nodes that are currently checked in the TreeView component.
The checkedNodes
property depends upon the value of showCheckBox
property.
For more information on checkedNodes, refer to
checkedNodes.
Declaration
public string[] CheckedNodes { get; set; }
Property Value
Type |
Description |
System.String[] |
|
ClassName
Declaration
protected override string ClassName { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
Created
Triggers when the TreeView control is created successfully.
Declaration
public string Created { get; set; }
Property Value
Type |
Description |
System.String |
|
CssClass
Specifies the CSS classes to be added with root element of the TreeView to help customize the appearance of the component.
Declaration
public string CssClass { get; set; }
Property Value
Type |
Description |
System.String |
|
DataBound
Triggers when data source is populated in the TreeView.
Declaration
public string DataBound { get; set; }
Property Value
Type |
Description |
System.String |
|
DataSourceChanged
Triggers when data source is changed in the TreeView. The data source will be changed after performing some operation like
drag and drop, node editing, adding and removing node.
Declaration
public string DataSourceChanged { get; set; }
Property Value
Type |
Description |
System.String |
|
Destroyed
Triggers when the TreeView control is destroyed successfully.
Declaration
public string Destroyed { get; set; }
Property Value
Type |
Description |
System.String |
|
Disabled
Specifies a value that indicates whether the TreeView component is disabled or not.
When set to true, user interaction will not be occurred in TreeView.
Declaration
public bool Disabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
DragArea
Defines the area in which the draggable element movement will be occurring. Outside that area will be restricted
for the draggable element movement. By default, the draggable element movement occurs in the entire page.
Declaration
public string DragArea { get; set; }
Property Value
Type |
Description |
System.String |
|
DrawNode
Triggers before the TreeView node is appended to the TreeView element. It helps to customize specific nodes.
Declaration
public string DrawNode { get; set; }
Property Value
Type |
Description |
System.String |
|
EnableHtmlSanitizer
Defines whether to allow the cross-scripting site or not.
Declaration
public bool EnableHtmlSanitizer { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
EnablePersistence
Enables or disables persisting TreeView state between page reloads. If enabled, following APIs will persist.
selectedNodes
- Represents the nodes that are selected in the TreeView component.
checkedNodes
- Represents the nodes that are checked in the TreeView component.
expandedNodes
- Represents the nodes that are expanded in the TreeView component.
Declaration
public bool EnablePersistence { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
ExpandedNodes
Represents the expanded nodes in the TreeView component. We can set the nodes that need to be
expanded or get the ID of the nodes that are currently expanded by using this property.
Declaration
public string[] ExpandedNodes { get; set; }
Property Value
Type |
Description |
System.String[] |
|
ExpandOn
Specifies the action on which the node expands or collapses. The available actions are,
Auto
- In desktop, the expand/collapse operation happens when you double-click the node, and in mobile devices it
happens on single-click.
Click
- The expand/collapse operation happens when you single-click the node in both desktop and mobile devices.
DblClick
- The expand/collapse operation happens when you double-click the node in both desktop and mobile devices.
None
- The expand/collapse operation will not happen when you single-click or double-click the node in both desktop
and mobile devices.
Declaration
public ExpandOnSettings ExpandOn { get; set; }
Property Value
Fields
Specifies the data source and mapping fields to render TreeView nodes.
Declaration
public TreeViewFieldsSettings Fields { get; set; }
Property Value
FullRowNavigable
If this property is set to true, then the entire TreeView node will be navigate-able instead of text element.
Declaration
public bool FullRowNavigable { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
FullRowSelect
On enabling this property, the entire row of the TreeView node gets selected by clicking a node.
When disabled only the corresponding node's text gets selected.
For more information on Fields concept, refer to
Fields.
Declaration
public bool FullRowSelect { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
HtmlAttributes
Allows additional HTML attributes such as title, name, etc., and
accepts n number of attributes in a key-value pair format.
Declaration
public object HtmlAttributes { get; set; }
Property Value
Type |
Description |
System.Object |
|
IsFor
Declaration
protected override bool IsFor { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
KeyPress
Triggers when key press is successful. It helps to customize the operations at key press.
Declaration
public string KeyPress { get; set; }
Property Value
Type |
Description |
System.String |
|
LoadOnDemand
By default, the load on demand (Lazy load) is set to true. By disabling this property, all the tree nodes are rendered at the
beginning itself.
Declaration
public bool LoadOnDemand { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
NameSpace
Declaration
protected override string NameSpace { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
NodeChecked
Triggers when the TreeView node is checked/unchecked successfully.
Declaration
public string NodeChecked { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeChecking
Triggers before the TreeView node is to be checked/unchecked.
Declaration
public string NodeChecking { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeClicked
Triggers when the TreeView node is clicked successfully.
Declaration
public string NodeClicked { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeCollapsed
Triggers when the TreeView node collapses successfully.
Declaration
public string NodeCollapsed { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeCollapsing
Triggers before the TreeView node collapses.
Declaration
public string NodeCollapsing { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeDragging
Triggers when the TreeView node is dragged (moved) continuously.
Declaration
public string NodeDragging { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeDragStart
Triggers when the TreeView node drag (move) starts.
Declaration
public string NodeDragStart { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeDragStop
Triggers when the TreeView node drag (move) is stopped.
Declaration
public string NodeDragStop { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeDropped
Triggers when the TreeView node is dropped on target element successfully.
Declaration
public string NodeDropped { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeEdited
Triggers when the TreeView node is renamed successfully.
Declaration
public string NodeEdited { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeEditing
Triggers before the TreeView node is renamed.
Declaration
public string NodeEditing { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeExpanded
Triggers when the TreeView node expands successfully.
Declaration
public string NodeExpanded { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeExpanding
Triggers before the TreeView node is to be expanded.
Declaration
public string NodeExpanding { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeSelected
Triggers when the TreeView node is selected/unselected successfully.
Declaration
public string NodeSelected { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeSelecting
Triggers before the TreeView node is selected/unselected.
Declaration
public string NodeSelecting { get; set; }
Property Value
Type |
Description |
System.String |
|
NodeTemplate
Specifies a template to render customized content for all the nodes. If the nodeTemplate
property
is set, the template content overrides the displayed node text. The property accepts template string
template string
or HTML element ID holding the content. For more information on template concept, refer to
Template.
Declaration
public string NodeTemplate { get; set; }
Property Value
Type |
Description |
System.String |
|
SelectedNodes
Represents the selected nodes in the TreeView component. We can set the nodes that need to be
selected or get the ID of the nodes that are currently selected by using this property.
On enabling allowMultiSelection
property we can select multiple nodes and on disabling
it we can select only a single node.
For more information on selectedNodes, refer to
selectedNodes.
Declaration
public string[] SelectedNodes { get; set; }
Property Value
Type |
Description |
System.String[] |
|
ShowCheckBox
Indicates that the nodes will display CheckBoxes in the TreeView.
The CheckBox will be displayed next to the expand/collapse icon of the node. For more information on CheckBoxes, refer to
CheckBox.
Declaration
public bool ShowCheckBox { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
SortOrder
Specifies a value that indicates whether the nodes are sorted in the ascending or descending order,
or are not sorted at all. The available types of sort order are,
None
- The nodes are not sorted.
Ascending
- The nodes are sorted in the ascending order.
Descending
- The nodes are sorted in the ascending order.
Declaration
public SortOrder SortOrder { get; set; }
Property Value
TagName
Declaration
protected override string TagName { get; }
Property Value
Type |
Description |
System.String |
|
Overrides