[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Collapse]Tree List
   [Expand]Product Information
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Data Editing
    [Expand]Data Shaping and Manipulation
     Drag and Drop
    [Expand]Focus and Navigation
     Appearance Customization
     Save and Restore Client Layout
   [Expand]Visual Elements
   [Expand]Member Tables
  [Expand]Card View
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [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]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


The DevExpress ASPxTreeList control enables you to group the most important or frequently used grid commands, and expose them through customizable toolbars for efficient end-user access.

See Online Demo: Toolbar

Expanded Toolbar Object

The ASPxTreeList stores toolbars in its ASPxTreeList.Toolbars collection. Each toolbar is a TreeListToolbar class instance. You can add and remove toolbars in the collection and change the following characteristics of individual toolbars:

Toolbar Characteristic Property Description
Adaptive Behavior GridToolbar.EnableAdaptivity Specifies whether an adaptive behavior is enabled for the toolbar.
Availability GridToolbar.Enabled Gets or sets a value that indicates whether the toolbar is enabled, allowing the toolbar to respond to end-user interactions.
Item Alignment GridToolbar.ItemAlign Gets or sets the toolbar item alignment.
Name GridToolbar.Name Gets or sets the toolbar's unique identifier name.
Position GridToolbar.Position Gets or sets the toolbar position.
Visibility GridToolbar.Visible Gets or sets a value specifying the visibility of the toolbar.

To populate a toolbar with toolbar items and to have indexed access to them, use the toolbar's TreeListToolbar.Items property.

Expanded Toolbar Item Object

Toolbar items are instances of the TreeListToolbarItem class. It is a descendant of the MenuItem class and so it inherits the following key functionality making a toolbar item appear and behave as a menu item.

Toolbar Item Characteristic Property Description
Group Separation MenuItem.BeginGroup Gets or sets a value that specifies whether the current menu item starts a group.
Group Name MenuItem.GroupName Gets or sets the name of a logical check group to which the menu item belongs.
Image MenuItem.Image Gets the settings of an image displayed within the menu item.
Name MenuItem.Name Gets or sets the unique identifier name for the current menu item.
Template MenuItem.Template Gets or sets a template used to display the content of the current menu item.
Text MenuItem.Text Gets or sets the text content of the current menu item.
Tooltip MenuItem.ToolTip Gets or sets the current menu item's tooltip text.

Additionally, you can use the following options explicitly implemented for toolbar items to properly customize their behavior and appearance.

Toolbar Item Characteristic Property Description
Display Mode GridToolbarItem.DisplayMode Gets or sets the display mode of the current toolbar item within the toolbar.
Command to Execute TreeListToolbarItem.Command Gets or sets the name of a command executed when clicking a toolbar item.
Child Items TreeListToolbarItem.Items Gets a collection that contains the toolbar items of the current toolbar item. Enables you to create hierarchies of nested toolbar items of unlimited depth.

Based on the TreeListToolbarItem.Command property setting, a toolbar item either triggers a standard grid command (that is, data item editing, deletion, creation, etc.) or performs a custom action, if required (this action should be implemented programmatically).

Expanded Standard Toolbar Item

To make a toolbar item execute a standard command, set the item's TreeListToolbarItem.Command property to the desired command name listed by the TreeListToolbarCommand enumeration. A standard toolbar item automatically displays the command-related text and image (optional). Clicking a standard toolbar item executes the corresponding grid command.

Expanded Example - How to create standard items

The code snippet below demonstrates how to create two standard toolbar items - for the New and Refresh commands - in the markup.

Expanded Custom Toolbar Item

If you need a toolbar item to perform a custom action, create a new TreeListToolbarItem object and use one of the following two implementation options.

Expanded Example - How to create custom items (specifying their names, texts and images)

The code below demonstrates how to create a custom 'Export to' toolbar item with three sub-items to export the grid data to different formats (PDF, XLSX and XLS).

Expanded See Also

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