Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Collapse]Tree List
   [Expand]Product Information
   [Collapse]Feature Center
    [Expand]Data Binding
    [Expand]Nodes
    [Expand]Data Editing
    [Expand]Data Representation
    [Expand]Sorting
    [Expand]Filtering
    [Expand]Summaries
    [Expand]Appearances and Look And Feel
    [Expand]Focus, Selection and Navigation
     Formatting Cell Values
    [Collapse]Miscellaneous
     [Collapse]Context Menus
       Add Custom Menu Items to the Standard Menus
       Change the Behavior of the Standard Menu Items
       Control the Availability of the Standard Context Menus to End-Users
       Custom Menus
       Customize the Standard Context Menus
       Disable and Remove Particular Items in the Standard Menus
       Standard Context Menus
     [Expand]Export and Import Data
     [Expand]Print XtraTreeList
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End User Capabilities
   [Expand]Member Tables
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Change the Behavior of the Standard Menu Items

Expanded Change the Behavior of the Standard Menu Items

Clicking any default item within the standard context menus fires the TreeList.TreeListMenuItemClick event. This event lets you cancel the default actions, or provide your own item handling.

When handling this event, you need to set the event's Handled parameter to true or false. Setting this parameter to true indicates that you've handled this event, and no default processing is required. If the Handled parameter is set to false, the default actions will be performed immediately after your event handler.

Expanded Example

The following sample code changes the behavior of the Sort Ascending and Sort Descending items of the column header menu. By default, clicking one of these items sorts the data by the values in the associated column without clearing the previously applied sorting. This allows sorting by multiple columns to be implemented.

In the example, the TreeList.TreeListMenuItemClick event is handled to clear the existing sorting, before the column values are sorted.

How would you rate this topic?​​​​​​​