Trusted by the world’s leading companies
Overview
The ASP.NET Core TreeView presents hierarchical data, such as a table of contents, organization hierarchy, or file directory, in a tree structure. A parent node can be expanded or collapsed to show or hide its child nodes. The TreeView is feature-rich, supporting data binding, loading on demand, multiple selection, drag and drop, node editing, checkboxes, templates, and more.
Why choose Syncfusion ASP.NET Core TreeView?
High performance
Load on demand (lazy load) is enabled by default to reduce bandwidth usage when consuming large amounts of data. Only first-level nodes are loaded initially, and then child nodes are loaded when their parent node is expanded.
Seamless data binding
Bind data to the TreeView component from any valid data source in JSON format. The tree data can be local or remote and retrieved via various adapters, such as OData, OData V4, URL, JSON, and web API.
Adapts to any resolution
TreeView has a highly responsive layout and an optimized design for desktops, touchscreens, and phones. It works well on all mobile phones that use iOS, Android, or Windows OS.
Admirable feature set
The ASP.NET Core TreeView supports load on demand, bound and unbound modes, drag and drop, multiselection, and editing.
Create your own template designs
It can be customized via node template support, which allows you to design a custom structure for tree nodes. Node templates can be used for parent nodes, child nodes, or both, and can include images and any custom element structure.
Visualize hierarchical data
The ASP.NET Core TreeView is a graphic user interface element that displays hierarchical data as a tree structure. It can be populated with nested arrays of JSON objects from a hierarchical data source.
Attractive, customizable themes
Cutting-edge design with several built-in themes, such as Fluent, Tailwind CSS, Bootstrap, Material, and Fabric. Utilize the online Theme Studio tool to customize themes of treeview easily.
Globalization and localization
Enable users from different locales to use the component by formatting dates, currency, and numbering to suit preferences.
ASP.NET Core TreeView Code Example
Easily get started with the ASP.NET Core TreeView using a few simple lines of C# code as demonstrated below. Also explore our ASP.NET Core TreeView Example that shows you how to render and configure the TreeView in ASP.NET Core.
@using Syncfusion.EJ2
<ejs-treeview id="treedata" >
<e-treeview-fields child="ViewBag.child" dataSource="ViewBag.dataSource" id="nodeId" parentId="pid" text="nodeText" hasChildren="hasChild" expanded="expanded"></e-treeview-fields>
</ejs-treeview>public IActionResult DefaultFunctionalities()
{
List<Parentitem> parentitem = new List<Parentitem>();
List<Childitem> childitem1 = new List<Childitem>();
List<SubChilditem> subchilditem1 = new List<SubChilditem>();
parentitem.Add(new Parentitem
{
nodeId = "01",
nodeText = "Local Disk (C:)",
expanded=true,
child = childitem1,
});
childitem1.Add(new Childitem { nodeId = "01-01", nodeText = "Program Files", child=subchilditem1 });
subchilditem1.Add(new SubChilditem { nodeId = "01-01-01", nodeText = "Windows NT" });
subchilditem1.Add(new SubChilditem { nodeId = "01-01-02", nodeText = "Windows Mail" });
subchilditem1.Add(new SubChilditem { nodeId = "01-01-03", nodeText = "Windows Photo Viewer" });
List<SubChilditem> subchilditem2 = new List<SubChilditem>();
childitem1.Add(new Childitem { nodeId = "01-02", nodeText = "Users", expanded=true, child = subchilditem2 });
subchilditem2.Add(new SubChilditem { nodeId = "01-02-01", nodeText = "Smith" });
subchilditem2.Add(new SubChilditem { nodeId = "01-02-02", nodeText = "Public" });
subchilditem2.Add(new SubChilditem { nodeId = "01-02-03", nodeText = "Admin" });
List<SubChilditem> subchilditem3 = new List<SubChilditem>();
childitem1.Add(new Childitem { nodeId = "01-03", nodeText = "Windows", child = subchilditem3 });
subchilditem3.Add(new SubChilditem { nodeId = "01-03-01", nodeText = "Boot" });
subchilditem3.Add(new SubChilditem { nodeId = "01-03-02", nodeText = "FileManager" });
subchilditem3.Add(new SubChilditem { nodeId = "01-03-03", nodeText = "System32" });
List<Childitem> childitem2 = new List<Childitem>();
parentitem.Add(new Parentitem
{
nodeId = "02",
nodeText = "Local Disk (D:)",
child = childitem2,
});
List<SubChilditem> subchilditem4 = new List<SubChilditem>();
childitem2.Add(new Childitem { nodeId = "02-01", nodeText = "Personals", child=subchilditem4});
subchilditem4.Add(new SubChilditem { nodeId = "02-01-01", nodeText = "My photo.png" });
subchilditem4.Add(new SubChilditem { nodeId = "02-01-02", nodeText = "Rental document.docx" });
subchilditem4.Add(new SubChilditem { nodeId = "02-01-03", nodeText = "Pay slip.pdf" });
List<SubChilditem> subchilditem5 = new List<SubChilditem>();
childitem2.Add(new Childitem { nodeId = "02-02", nodeText = "Projects",child=subchilditem5 });
subchilditem5.Add(new SubChilditem { nodeId = "02-02-01", nodeText = "ASP Application " });
subchilditem5.Add(new SubChilditem { nodeId = "02-02-02", nodeText = "TypeScript Application" });
subchilditem5.Add(new SubChilditem { nodeId = "02-02-03", nodeText = "React Application" });
List<SubChilditem> subchilditem6 = new List<SubChilditem>();
childitem2.Add(new Childitem { nodeId = "02-02", nodeText = "Office", child = subchilditem6 });
subchilditem6.Add(new SubChilditem { nodeId = "02-03-01", nodeText = "Work details.docx " });
subchilditem6.Add(new SubChilditem { nodeId = "02-03-02", nodeText = "Weekly report.docx" });
subchilditem6.Add(new SubChilditem { nodeId = "02-03-03", nodeText = "Wish list.csv" });
List <Childitem> childitem3 = new List<Childitem>();
parentitem.Add(new Parentitem
{
nodeId = "03",
nodeText = "Local Disk (E:)",
child = childitem3,
});
List<SubChilditem> subchilditem7 = new List<SubChilditem>();
childitem3.Add(new Childitem { nodeId = "03-01", nodeText = "Pictures" , child=subchilditem7});
subchilditem7.Add(new SubChilditem { nodeId = "03-01-01", nodeText = "Wind.jpg " });
subchilditem7.Add(new SubChilditem { nodeId = "03-01-02", nodeText = "Stone.jpg" });
subchilditem7.Add(new SubChilditem { nodeId = "03-01-03", nodeText = "Home.jpg" });
List<SubChilditem> subchilditem8 = new List<SubChilditem>();
childitem3.Add(new Childitem { nodeId = "03-02", nodeText = "Documents", icon = "docx" , child=subchilditem8});
subchilditem8.Add(new SubChilditem { nodeId = "03-02-01", nodeText = "Environment Pollution.docx " });
subchilditem8.Add(new SubChilditem { nodeId = "03-02-02", nodeText = "Global Warming.ppt" });
subchilditem8.Add(new SubChilditem { nodeId = "03-02-03", nodeText = "Social Network.pdf" });
List<SubChilditem> subchilditem9 = new List<SubChilditem>();
childitem3.Add(new Childitem { nodeId = "03-03", nodeText = "Study Materials",child=subchilditem9 });
subchilditem9.Add(new SubChilditem { nodeId = "03-03-01", nodeText = "UI-Guide.pdf" });
subchilditem9.Add(new SubChilditem { nodeId = "03-03-02", nodeText = "Tutorials.zip" });
subchilditem9.Add(new SubChilditem { nodeId = "03-03-03", nodeText = "TypeScript.7z" });
ViewBag.dataSource = parentitem;
char[] value = { 'c', 'h', 'i','l','d' };
string Child = new string(value);
ViewBag.child = Child;
return View();
}
public class Parentitem
{
public string nodeId;
public string nodeText;
public string icon;
public bool expanded;
public bool selected;
public List<Childitem> child;
}
public class Childitem
{
public string nodeId;
public string nodeText;
public string icon;
public bool expanded;
public bool selected;
public List<SubChilditem> child;
}
public class SubChilditem
{
public string nodeId;
public string nodeText;
public string icon;
public bool expanded;
public bool selected;
}Icons and images
Present nodes with icons or images along with content.
Built-in checkboxes
Built-in support to display checkboxes in each node, allowing multiple selection of nodes. Checkboxes for parent nodes also have a tri-state mode: checked, unchecked, and indeterminate state.
Drag and drop nodes
In ASP.NET Core TreeView, nodes can be reordered by simply dragging and dropping them.
Internal drag and drop
Tree nodes can be dragged from one parent node to another within the same level or different levels.
Drag between TreeView
Users can drag nodes from one TreeView to another.
External drag and drop
Extend the drag and drop operation from TreeView to other controls like ListView.
Multiple selection of nodes
ASP.NET Core TreeView allows users to select multiple nodes using checkboxes or the Shift and Ctrl keys.
Inline node editing
Modify the tree nodes’ labels using the mouse, touch, or keyboard.
Sorting nodes
Sort the tree view nodes in ascending or descending order based on their labels.
Node template
Customize the content of each parent and child node using images or custom elements in the ASP.NET Core TreeView.
Expand and collapse nodes
Easily customize the expand and collapse icons based on the requirement of your application.
Context menu
Integrate a context menu into ASP.NET Core TreeView to perform node manipulations such as adding, removing, and renaming nodes.
Text wrap
A node’s text wraps when it reaches edge of the TreeView. The node’s height will adjust automatically based on the content.
Customization by node level
Customize the tree nodes based on their level, such as leaf nodes, sibling nodes, first-level nodes, and second level nodes.
Node validation
Add validation to the labels of tree nodes on editing, like a minimum or maximum length.
Tooltips for tree nodes
It supports tooltips for tree nodes that display information about the nodes while hovering over them. You can bind a tooltip from a data source along with node fields.
Accessibility
The ASP.NET Core TreeView component is easily accessed by screen readers. Complete keyboard interaction support has also been provided.
Keyboard navigation
The ASP.NET Core TreeView component ensures that every cell is accessible using the keyboard. Major features like sort, select, and edit can be performed using keyboard commands alone; no mouse interaction is required. This helps in creating highly accessible applications using this component.
Screen reader
The ASP.NET Core TreeView has complete WAI-ARIA accessibility support. The Data Grid UI includes high-contrast visual elements that help visually impaired people to have the best viewing experience. Also, valid UI descriptions are easily accessible through assistive technologies such as screen readers.
Right to left (RTL)
Right-to-left rendering allows displaying the text and layout of the TreeView from right to left. This improves the user experience and accessibility for RTL languages.
Other supported frameworks
The TreeView is available for the in Blazor, React, Angular, JavaScript, Vue, and ASP.NET MVC frameworks. Explore its platform-specific options through the following links:
Supported browsers
The ASP.NET Core TreeView works well with all modern web browsers, including Chrome, Firefox, Edge, Safari, and Opera.
Not sure how to create your first ASP.NET Core TreeView? Our documentation can help.
I’d love to read it now140+ ASP.NET CORE UI CONTROLS
Frequently Asked Questions
Why should you choose Syncfusion ASP.NET Core Tree View?
Syncfusion ASP.NET Core Tree View provides the following features:
- Display hierarchical data in a tree structure.
- Load a wide range of nodes with optimal performance.
Flexible data binding with support to use local and remote data sources such as JSON, RESTful services, OData services, and WCF services.
Drag and drop multiple selected tree nodes anywhere.
Select multiple nodes using built-in checkboxes.
Edit node text inline with editable node support.
Customize nodes, expand icons, and collapse icons.
- One of the best ASP.NET Core Treeview in the market that offers feature-rich UI to interact with the software.
- Simple configuration and API.
- Supports all modern browsers.
- Mobile-touch friendly and responsive.
Expansive learning resources such as demos and documentation to learn quickly and get started fast.
Where can I find the Syncfusion ASP.NET Core Tree View demo?
You can find our ASP.NET Core Tree View demo, which demonstrates how to render and configure the TreeView.
Can I download and utilize the Syncfusion ASP.NET Core Tree View for free?
No, this is a commercial product and requires a paid license. However, a free community license is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue, 5 or fewer developers, and 10 or fewer total employees.
How do I get started with Syncfusion ASP.NET Core Tree View?
A good place to start would be our comprehensive getting started documentation.
Our Customers Love Us
Here are some of their experiences.
Awards
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.