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
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Data Binding
   [Expand]Views
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Collapse]Sorting
     Sorting in Code
   [Expand]Filter and Search
   [Expand]Summaries
   [Expand]Focus and Selection Handling
    Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
    Split Presentation
    Row Preview Sections
    Scrolling
   [Expand]Batch Modifications
   [Expand]Hit Information
    Hints
   [Expand]Popup Menus
   [Expand]Saving and Restoring Layouts
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [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

Sorting

This section provides information on sorting data in the Data Grid.

Expanded Sort Data

By default, end-users can sort data by any column, except for columns with MemoExEdit, ImageEdit and PictureEdit in-place editors. At runtime, click a column header once to sort data ascending. Consequent clicks will reverse the sort order. Sort glyph (up or down arrow) in column headers indicates the current sort order.

To sort data by a specific column end-users can also right-click this column's header and select "Sort Ascending" or "Sort Descending".

Related API

Expanded Multi-Column Sorting

The Data Grid discards the currently applied sorting when end-users click column headers, and keeps it when users sort data through header context menus. Thus, to sort data by multiple columns, end-users should either utilize header context menus or hold the Shift key down when clicking column headers. In the figure below, data is first sorted ascending by the "Customer ID" field and then descending by order dates.

Expanded Clear Sorting

To remove data sorting by a specific column, end-users should click this column's header with the Ctrl key pressed. Alternatively, a user can right-click this header and select "Clear Sorting". To simultaneously remove sorting by all columns, select "Clear All Sorting" instead.

Related API

  • GridOptionsCustomization.AllowSort - prevents end-users from unsorting data by Ctrl+clicking column headers and disables the "Clear Sorting" option for all grid columns.
  • OptionsColumn.AllowSort - prevents end-users from unsorting data by Ctrl+clicking this column's header and disables the "Clear Sorting" option for this column.
  • GridView.PopupMenuShowing - allows you to manually modify or remove context menu items, with which end-users can change sorting. The code below changes the "Clear All Sorting" item behavior so that end-users will be unable to remove the predefined sorting by the "Order Date" column.

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