New to Telerik UI for ASP.NET MVC? Download free 30-day trial
ASP.NET MVC Grid Sorting
- EXAMPLE
- VIEW SOURCE
-
Change Theme
defaultSASSLESSDefault Theme
- Main
- Main Dark
- Nordic
- Ocean Blue
- Purple
- Turquoise
Bootstrap Theme- Main
- Main Dark
- Nordic
- Urban
- Vintage
Material Theme- Main
- Arctic
- Lime Dark
- Main Dark
- Nova
Classic Theme- Main
- Main Dark
- Opal
- Silver
Fluent Theme- Main
Also available for:
CLIENT-SIDE API SERVER-SIDE APIDescription
The Telerik UI for ASP.NET MVC Grid
supports built-in options which enable you to implement sorting features for the users. To set the sorting functionality, configure the .Sortable()
method of the Data Grid.
The Grid component supports the Single, Multiple, and
Mixed sorting modes. To specify the desired sorting mode, set the SortMode
method by passing a GridSortMode
the SingleColumn
, MultipleColumn
, or Mixed
configurations in the following ways:
- To define a single-column sorting, use the
.Sortable(sortable => sortable.SortMode(GridSortMode.SingleColumn)
configuration. - To define a multi-column sorting, use the
.Sortable(sortable => sortable.SortMode(GridSortMode.MultipleColumn)
definition. - To define a mixed-column sorting, use the
.Sortable(sortable => sortable.SortMode(GridSortMode.Mixed)
definition.
To define the initial sort direction use the InitialDirection()
method by setting .Sortable(sortable => sortable.InitialDirection("desc"))
.
For more information, refer to the official Telerik UI for ASP.NET MVC Data Grid product documentation on the available sorting capabilities.