Sorting
By default, sorting in the Grid is disabled.
For a runnable example, refer to the demo on sorting in the Grid.
Getting Started
To enable the sorting functionality of the Grid, set the sortable
option to true
. As a result, the default single-column sorting functionality will be applied.
To enhance the performance of the Grid, apply the sorting operations on the server by setting the serverSorting
option of the data source to true
. When server-sorting is enabled, you will receive the default orderBy
parameter which contains the field name of the column by which the sorting of the dataset will be applied.
Figure 1: A Grid with its sorting functionality enabled
Sort Modes
The Grid supports the following sort modes:
Single-Column Sorting
By default, the Grid applies single-column sorting when sortable
is set to true
. You can also configure the single-column sort mode by setting the mode
option of editable
to single
.
$("#grid").kendoGrid({
sortable: true
// Other configuration.
});
Multi-Column Sorting
To enable multi-column sorting, set the mode
option of editable
to multiple
.
$("#grid").kendoGrid({
sortable: {
mode: "multiple"
},
// Other configuration.
});
KB Articles on Sorting
- Enable Sorting for Columns Bound to Complex Object
- Enabling the ForeignKey Column Sorting by Text
- Implementing Stable Sorting in Chrome
- Implementing Stable Sorting for Grouped Data in Chrome
- Adding Background Color to Sorted Columns by Using LESS Themes
- Find Out More in the Knowledge Base