Skip to main content

Tree View

  • 3 minutes to read

TreeView is a UI component that displays a tree of text nodes.

Run Demo: TreeView Read Tutorial

Getting Started

The TreeView UI Control is based on the DevExtreme TreeView component.

The following help topics explain how to add this control to your project:

Basic Syntax

@using ASP.NET_Core.Models.TreeView
@model IEnumerable<Employee>

@(Html.DevExtreme().TreeView()
    .DataSource(Model)
    .DataStructure(TreeViewDataStructure.Plain)
    .KeyExpr("ID")
    .ParentIdExpr("Head_ID")
    .ExpandedExpr("Expanded")
    .ItemTemplate("<div><%- Full_Name %> (<%- Title %>)</div>")
)

Built-in Capabilities and Configuration Guides

API

Server-Side API

Initialization
Call the TreeView() method to create a TreeView control. This action initializes a TreeViewBuilder instance. Use the instance methods to specify TreeView options and event handlers.
Options
For a complete option list, see TreeViewBuilder Members. For details on how to specify control options, refer to the following help topic: Specify Options.
Events
For available events, see Events. For details on how to handle events, refer to the following help topic: Handle Events and Define Callbacks.

Client-Side API

Options
If you need to specify the TreeView options dynamically on the client side, use client-side API. For a complete option list, see DevExtreme TreeView options.
Methods
For a list of available methods, see DevExtreme TreeView methods. For details on how to call methods, refer to the following help topic: Call Methods.

Accessibility

For more information on TreeView accessibility compliance, refer to the following help topic: Accessibility.

Demos

Run Demo: TreeView