New to Telerik UI for ASP.NET MVC? Download free 30-day trial

GridGroupableSortSettingsBuilder

Methods

Compare(System.String)

Sets the sort compare when grouping.

Parameters

compare - System.String

The name of a JavaScript function which is used to compare the groups (refer to sortable for sorting the items of the groups). It has the same signature as the compare function accepted by Array.sort.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID);
                    columns.Bound(p => p.Freight);
                })
                .Groupable(g => g.Sort(s => s.Compare("compare")))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )

Dir(System.ComponentModel.ListSortDirection)

Sets the sort direction when grouping.

Parameters

direction - System.ComponentModel.ListSortDirection

The sort order of the groups according to the group field.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID);
                    columns.Bound(p => p.Freight);
                })
                .Groupable(g => g.Sort(s => s.Dir(System.ComponentModel.ListSortDirection.Descending)))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )

In this article
Not finding the help you need?