Syncfusion.EJ2
Properties  Methods 


TreeView Class Members

The following tables list the members exposed by TreeView.

Public Constructors
 NameDescription
Public Constructor  
Top
Public Properties
 NameDescription
Public Property Triggers when any TreeView action failed to fetch the desired results.  
Public Property 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](../../treeview/drag-and-drop/).  
Public Property 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](../../treeview/node-editing/).  
Public Property 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.  
Public Property Specifies the type of animation applied on expanding and collapsing the nodes along with duration.  
Public Property Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node.  
Public Property 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](../../treeview/check-box#checked-nodes).  
Public Property Triggers when the TreeView control is created successfully.  
Public Property Specifies the CSS classes to be added with root element of the TreeView to help customize the appearance of the component.  
Public Property Triggers when data source is populated in the TreeView.  
Public Property 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.  
Public Property Triggers when the TreeView control is destroyed successfully.  
Public Property Triggers before the TreeView node is appended to the TreeView element. It helps to customize specific nodes.  
Public Property Defines whether to allow the cross-scripting site or not.  
Public Property Enables or disables persisting TreeView state between page reloads. If enabled, following APIs will persist. 1. `selectedNodes` - Represents the nodes that are selected in the TreeView component. 2. `checkedNodes` - Represents the nodes that are checked in the TreeView component. 3. `expandedNodes` - Represents the nodes that are expanded in the TreeView component.  
Public Property Enable or disable rendering component in right to left direction.  
Public Property 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.  
Public Property 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.  
Public Property Specifies the data source and mapping fields to render TreeView nodes.  
Public Property 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](../../treeview/data-binding#local-data).  
Public Property Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format.  
Public Property (Inherited from Syncfusion.EJ2.EJTagHelper)
Public Property Triggers when key press is successful. It helps to customize the operations at key press.  
Public Property 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.  
Public Property Overrides the global culture and localization value for this component. Default global culture is 'en-US'.  
Public Property Triggers when the TreeView node is checked/unchecked successfully.  
Public Property Triggers before the TreeView node is to be checked/unchecked.  
Public Property Triggers when the TreeView node is clicked successfully.  
Public Property Triggers when the TreeView node collapses successfully.  
Public Property Triggers before the TreeView node collapses.  
Public Property Triggers when the TreeView node is dragged (moved) continuously.  
Public Property Triggers when the TreeView node drag (move) starts.  
Public Property Triggers when the TreeView node drag (move) is stopped.  
Public Property Triggers when the TreeView node is dropped on target element successfully.  
Public Property Triggers when the TreeView node is renamed successfully.  
Public Property Triggers before the TreeView node is renamed.  
Public Property Triggers when the TreeView node expands successfully.  
Public Property Triggers before the TreeView node is to be expanded.  
Public Property Triggers when the TreeView node is selected/unselected successfully.  
Public Property Triggers before the TreeView node is selected/unselected.  
Public Property 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](http://ej2.syncfusion.com/documentation/base/template-engine.html) or HTML element ID holding the content. For more information on template concept, refer to [Template](../../treeview/template/).  
Public Property 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](../../treeview/multiple-selection#selected-nodes).  
Public Property 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](../../treeview/check-box/).  
Public Property 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.  
Top
Protected Properties
 NameDescription
Protected PropertyOverridden.   
Protected Property (Inherited from Syncfusion.EJ2.EJTagHelper)
Protected Property (Inherited from Syncfusion.EJ2.EJTagHelper)
Protected Property (Inherited from Syncfusion.EJ2.EJTagHelper)
Protected PropertyOverridden.   
Protected PropertyOverridden.   
Protected Property (Inherited from Syncfusion.EJ2.EJTagHelper)
Protected PropertyOverridden.   
Top
Public Methods
Protected Methods
 NameDescription
Protected Method (Inherited from Syncfusion.EJ2.EJTagHelper)
Top
Extension Methods
 NameDescription
Public Extension MethodOverloaded.  Iterates the index.
Top
See Also