Class TreeView
Inheritance
Namespace: Syncfusion.EJ2.Navigations
Assembly: Syncfusion.EJ2.dll
Syntax
public class TreeView : EJTagHelper
Constructors
TreeView()
Declaration
public TreeView()
Properties
ActionFailure
Event callback that is raised while any TreeView action failed to fetch the desired results.
Declaration
public string ActionFailure { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
AllowDragAndDrop
Declaration
public bool AllowDragAndDrop { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
AllowEditing
Declaration
public bool AllowEditing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
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 | The default value is false |
AllowTextWrap
Enables or disables text wrapping when text exceeds the bounds in the TreeView node. When the allowTextWrap property is set to true, the TreeView node text content will wrap to the next line when it exceeds the width of the TreeView node. The TreeView node height will be adjusted automatically based on the TreeView node content.
Declaration
public bool AllowTextWrap { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
Animation
Specifies the type of animation applied on expanding and collapsing the nodes along with duration.
Declaration
public TreeViewNodeAnimationSettings Animation { get; set; }
Property Value
Type | Description |
---|---|
TreeViewNodeAnimationSettings | The default value is null |
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 | The default value is true |
CheckDisabledChildren
Determines whether the disabled children will be checked or not if their parent is checked.
Declaration
public bool CheckDisabledChildren { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
CheckedNodes
Declaration
public string[] CheckedNodes { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | The default value is null |
Created
Event callback that is raised when the TreeView component is created successfully.
Declaration
public string Created { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
CssClass
Specifies one or more than one 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 | The default value is "" |
DataBound
Event callback that is raised when data source is populated in the TreeView.
Declaration
public string DataBound { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
DataSourceChanged
Event callback that is raised 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 | The default value is null |
Destroyed
Event callback that is raised when the TreeView control is destroyed successfully.
Declaration
public string Destroyed { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
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 | The default value is false |
DragArea
Specifies the target in which the draggable element can be moved and dropped. By default, the draggable element movement occurs in the page.
Declaration
public string DragArea { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
DrawNode
Event callback that is raised 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 | The default value is null |
EnableHtmlSanitizer
Specifies whether to display or remove the untrusted HTML values in the TreeView component. If 'enableHtmlSanitizer' set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
Declaration
public bool EnableHtmlSanitizer { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
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 | The default value is false |
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
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[] | The default value is null |
ExpandOn
Specifies the action on which the node expands or collapses.
The available actions :
Click
- The expand/collapse operation happens when you single-click on the node in desktop.
DblClick
- The expand/collapse operation happens when you double-click on the node in desktop.
None
- The expand/collapse operation will not happen.
In mobile devices, the node expand/collapse action happens on single tap.
Here ExpandOn attribute is set to single click property also can use double click and none property.
Declaration
public ExpandOnSettings ExpandOn { get; set; }
Property Value
Type | Description |
---|---|
ExpandOnSettings | The default value is ExpandOnSettings.Auto |
Fields
Specifies the data source and mapping fields to render TreeView nodes.
Declaration
public TreeViewFieldsSettings Fields { get; set; }
Property Value
Type | Description |
---|---|
TreeViewFieldsSettings | The default value is null |
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 | The default value is false |
FullRowSelect
Declaration
public bool FullRowSelect { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
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 |
---|
System.Object |
KeyPress
Event callback that is raised 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 | The default value is null |
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 | The default value is true |
NodeChecked
Event callback that is raised when the TreeView node is checked/unchecked successfully.
Declaration
public string NodeChecked { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeChecking
Event callback that is raised before the TreeView node is to be checked/unchecked.
Declaration
public string NodeChecking { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeClicked
Event callback that is raised when the TreeView node is clicked successfully.
Declaration
public string NodeClicked { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeCollapsed
Event callback that is raised when the TreeView node collapses successfully.
Declaration
public string NodeCollapsed { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeCollapsing
Event callback that is raised before the TreeView node collapses.
Declaration
public string NodeCollapsing { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeDragging
Event callback that is raised when the TreeView node is dragged (moved) continuously.
Declaration
public string NodeDragging { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeDragStart
Event callback that is raised when the TreeView node drag (move) starts.
Declaration
public string NodeDragStart { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeDragStop
Event callback that is raised when the TreeView node drag (move) is stopped.
Declaration
public string NodeDragStop { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeDropped
Event callback that is raised when the TreeView node is dropped on target element successfully.
Declaration
public string NodeDropped { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeEdited
Event callback that is raised when the TreeView node is renamed successfully.
Declaration
public string NodeEdited { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeEditing
Event callback that is raised before the TreeView node is renamed.
Declaration
public string NodeEditing { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeExpanded
Event callback that is raised when the TreeView node expands successfully.
Declaration
public string NodeExpanded { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeExpanding
Event callback that is raised before the TreeView node is to be expanded.
Declaration
public string NodeExpanding { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeSelected
Event callback that is raised when the TreeView node is selected/unselected successfully.
Declaration
public string NodeSelected { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeSelecting
Event callback that is raised before the TreeView node is selected/unselected.
Declaration
public string NodeSelecting { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
NodeTemplate
Declaration
public string NodeTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
SelectedNodes
Declaration
public string[] SelectedNodes { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | The default value is null |
ShowCheckBox
Declaration
public bool ShowCheckBox { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
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
Type | Description |
---|---|
SortOrder | The default value is SortOrder.None |