Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Expand]Charting
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Collapse]Site Navigation and Layout
   [Expand]FormLayout
   [Expand]Menu
   [Expand]NavBar
   [Expand]Ribbon
   [Expand]PageControl
   [Expand]TabControl
   [Expand]PopupMenu
   [Expand]Splitter
   [Collapse]TreeView
     Overview - TreeView
    [Collapse]Concepts
      Node
     [Expand]Binding to Data
      Expanding and Collapsing Nodes
      Animation Effect
      Selection
      Node Link Mode
      Check Box Support
      Callbacks
      Templates
    [Expand]Visual Elements
   [Expand]Panel
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors Extensions
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Extensions
  [Expand]SpellChecker
  [Expand]Query Builder
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Expanding and Collapsing Nodes

TreeView allows end-users to hide/show a node children. End-users can expand or collapse nodes by double-clicking them. It is also possible to expand/collapse nodes by clicking expand buttons. The visibility of these buttons can be controlled by using the TreeViewSettings.ShowExpandButtons property.

TreeView provides the server and client API, which expand and collapse nodes in code. You can perform the following actions with a node.

To impact a particular node: Client Members Server Members
To expand/collapse a particular node ASPxClientTreeViewNode.SetExpanded TreeViewNode.Expanded (via MVCxTreeViewNode.Expanded)
To determine the node's expansion state ASPxClientTreeViewNode.GetExpanded TreeViewNode.Expanded (via MVCxTreeViewNode.Expanded)
To expand TreeView down to the specified node ASPxTreeView.ExpandToNode (via MVCxTreeView.ExpandToNode)

To impact all nodes: Client Members Server Members
To expand all nodes ASPxClientTreeView.ExpandAll (via MVCxClientTreeView.ExpandAll) ASPxTreeView.ExpandAll (via MVCxTreeView.ExpandAll)
To collapse all nodes ASPxClientTreeView.CollapseAll (via MVCxClientTreeView.CollapseAll) ASPxTreeView.CollapseAll (via MVCxTreeView.CollapseAll)
To expand all nodes to the defined depth ASPxTreeView.ExpandToDepth (via MVCxTreeView.ExpandToDepth)

To respond to expanding/collapsing nodes: Client Events Server Events
Before action ASPxClientTreeView.ExpandedChanging (via MVCxClientTreeView.ExpandedChanging) ASPxTreeView.ExpandedChanging (via MVCxTreeView.ExpandedChanging)
After action ASPxClientTreeView.ExpandedChanged (via MVCxClientTreeView.ExpandedChanged) ASPxTreeView.ExpandedChanged (via MVCxTreeView.ExpandedChanged)

Is this topic helpful?​​​​​​​