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
    [Collapse]Sorting
      TreeList Sorting Specifics
      Sorting at Runtime
      Sorting via Code
      Custom Sorting
    [Expand]Filtering
    [Expand]Summaries
    [Expand]Appearances and Look And Feel
    [Expand]Focus, Selection and Navigation
     Formatting Cell Values
    [Expand]Miscellaneous
   [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]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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Sorting at Runtime

Expanded Sorting at Runtime

To sort data against a Tree List's column, or to change the column's sort order, an end-user can click its column header. The column's current sort order is indicated by the sort glyph (a small arrow displayed on the right edge of the column header). If the data is sorted in ascending order, the sort glyph represents an up-arrow. When sorting in descending order the sort glyph is displayed as a down-arrow. If the column isn't sorted, the sort glyph is hidden.

In the following image, data is sorted against the Department column in ascending order and against the Budget column in descending order.

If sorting isn't applied, clicking the column header sorts the data in ascending order by the column's contents. If sorting is already applied to the column, subsequent clicks reverse the current sort order. Note that a regular click on a column header clears the sort settings of any other columns. To preserve the existing sort settings of other columns, hold the SHIFT key down while clicking. This can be useful when you need to apply sorting to multiple columns at the same time. You can clear a column's sorting by clicking its header while holding the CTRL key down.

You can also apply sorting to columns via the column header context menu:

This availability of this menu is controlled by the Tree List's TreeListOptionsMenu.EnableColumnMenu property. You can also customize the menu's content as described in the Context Menus section.

Each column has an TreeListOptionsColumn.AllowSort property, which specifies whether an end-user can sort data against this column. The sort order, however, can always be changed in code.

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