Tab
A newer version of this page is available. Switch to the current version.

ASPxTreeView Class

Represents the web navigation treelike control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

public class ASPxTreeView :
    ASPxHierarchicalDataWebControl,
    IRequiresLoadPostDataControl,
    IControlDesigner
Public Class ASPxTreeView
    Inherits ASPxHierarchicalDataWebControl
    Implements IRequiresLoadPostDataControl,
               IControlDesigner

The following members accept/return ASPxTreeView objects:

Remarks

Add an ASPxTreeView control to your web application to provide it with the advanced navigation capabilities. This control allows you to display a hierarchical data as a tree.

TreeView - ASPxTreeView

The ASPxTreeView control supports the following common features:

  • Data binding that allows the control's nodes to be bound to hierarchal data sources.
  • Programmatic access to the ASPxTreeView object model to dynamically create nodes, populate them with child nodes, set properties, and so on.
  • Programmatic access to the ASPxTreeView client-side object model to perform specific client actions with nodes.
  • An ability to perform round-trips to the server using the AJAX-based callback technology.
  • Customizable appearance through themes, user-defined images, styles, and user-defined templates.

An ASPxTreeView control is made up of a tree of nodes represented by TreeViewNode objects. The parent node for all nodes, displayed within the ASPxTreeView is called the root node. This is a special node which isn't displayed and can be accessed via the ASPxTreeView.RootNode property. The collection of its child nodes can be accessed via the ASPxTreeView.Nodes property. A node can have its own child nodes, that are stored in the parent node's TreeViewNode.Nodes collection. This enables you to create a hierarchical structure of any complexity.

Each node of an ASPxTreeView control is capable of displaying any text specified by its TreeViewNode.Text property, a node image, which can be defined via the TreeViewNode.Image property, a check box, whose visibility is controlled by the ASPxTreeView.AllowCheckNodes and TreeViewNode.AllowCheck properties, and a tooltip text set via the TreeViewNode.ToolTip property.

The response of nodes to end-user clicks can be specified in two ways:

  • Specify the TreeViewNode.NavigateUrl property of a node. In this instance, the browser will navigate to the specified linked page when a node is clicked. By default, a linked page is displayed in the same window or frame as the ASPxTreeView control. To display the linked content in a different window or frame, use the ASPxTreeView's ASPxTreeView.Target property (or the TreeViewNode.Target property for a particular node).
  • Handle the ASPxTreeView.NodeClick event, in order to process them either on the server or client, depending upon the ASPxTreeView control's ASPxTreeView.AutoPostBack property setting.

In order to control the clickable area of items, the ASPxTreeView.NodeLinkMode property can be used.

Nodes can be expanded/collapsed via the user interface (using expand buttons or double clicking nodes) or programmatically (see the TreeViewNode.Expanded property and the ASPxTreeView.CollapseAll, ASPxTreeView.ExpandAll, ASPxTreeView.ExpandToDepth, and ASPxTreeView.ExpandToNode methods) in order to show/hide their contents. The visibility of nodes can be controlled by the TreeViewNode.Visible property.

The look of the ASPxTreeView control's default elements can be completely modified by creating a specific