Sort Data

The Data Grid was moved to maintenance support mode. No new features/capabilities will be added to this component. We recommend that you migrate to the Grid component.

ID
Contact Name
Company Name
City
Country
CACTU Patricio Simpson Cactus Comidas para llevar Buenos Aires Argentina
OCEAN Yvonne Moncada Océano Atlántico Ltda. Buenos Aires Argentina
RANCH Sergio Gutiérrez Rancho grande Buenos Aires Argentina
ERNSH Roland Mendel Ernst Handel Graz Austria
PICCO Georg Pipps Piccolo und mehr Salzburg Austria
MAISD Catherine Dewey Maison Dewey Bruxelles Belgium
SUPRD Pascale Cartrain Suprêmes délices Charleroi Belgium
GOURL André Fonseca Gourmet Lanchonetes Campinas Brazil
WELLI Paula Parente Wellington Importadora Resende Brazil
HANAR Mario Pontes Hanari Carnes Rio de Janeiro Brazil
of 10

Users can click a column header to sort the Data Grid by this column. They can click the header again to change the sort order. The sort glyph indicates the column's current sort order. To sort the Data Grid against multiple columns, users should click column headers with the Shift key pressed. To clear sorting, users can hold the Ctrl key and click the column headers.

Set the DxDataGrid.AllowSort property to false to disable sorting in the entire Data Grid. Use a column's AllowSort property to enable/disable sorting by individual columns.

Use the following column properties to sort data in code:

  • SortOrder — Specifies a column's sort order.
  • SortIndex — Specifies a column's position among sorted columns.

In this demo, values in the ID column cannot be sorted. The sort order for the Country and City columns are specified in the Data Grid's markup (see the code above).