New to Telerik UI for ASP.NET Core? Download free 30-day trial

ASP.NET Core TreeView Basic Usage

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
  • Edit in Telerik REPL
HtmlHelper
TagHelper
Files:
basic_usage.cshtml
Basic_UsageController.cs
Basic_Usage_TagHelper.cshtml

Also available for:

CLIENT-SIDE API HTML HELPER API

Description

The Telerik UI for ASP.NET Core TreeView is commonly used to navigate directories and files on a file system. The directory nodes contain subdirectories and files, which are visible on expand. Also, the component can illustrate the hierarchical relationship of items to their peers and nodes.

This example demonstrates a basic configuration of the TreeView, where all nodes are represented with texts and sprites. Rather than including a separate image file for each node, you can set a single image with CSS by using the background-image property, and specify the respective sprite CSS class for each node by using the SpriteCssClasses() option. In this way, the total number of HTTP requests will be reduced.

Additional Apps

This TreeView example is part of unique collection of hundreds of ASP.NET Core demos, with which you can see all Telerik ASP.NET Core components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Telerik REPL for ASP.NET Core or ThemeBuilder.

Support & Learning Resources

Additional Resources