Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Sorting in Code

  • 2 minutes to read

Note

Sorting by display text and custom sorting are not supported in Server Mode.

#Sorting

The following methods and properties can be used to sort data:

#Unsorting

To unsort data by the values of a single column, do one of the following:

To clear the sorting applied to the grid, use the DataControlBase.ClearSorting method.

Note

If grouping is applied, the DataControlBase.ClearSorting method preserves sorting applied to grouping columns, because group rows are always sorted.

#Sorting Events

When sorting data, the grid does the following:

Note

Group rows are always sorted. The StartSorting and EndSorting events are also raised before and after data is grouped.