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

Defines the fluent interface for configuring groupable sort settings.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class GridGroupableSortSettingsBuilder

Inheritance: objectGridGroupableSortSettingsBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the GridGroupableSortSettingsBuilder class.

C#
public GridGroupableSortSettingsBuilder(GridGroupableSortSettings settings)
Parameters:settingsGridGroupableSortSettings

The settings.

Methods

Sets the sort compare when grouping.

C#
public GridGroupableSortSettingsBuilder Compare(string compare)
Parameters:comparestring

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.

Returns:

GridGroupableSortSettingsBuilder

Example:
C#
@(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"))
)
)

Sets the sort direction when grouping.

C#
public GridGroupableSortSettingsBuilder Dir(ListSortDirection direction)
Parameters:directionListSortDirection

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

Returns:

GridGroupableSortSettingsBuilder

Example:
C#
@(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"))
)
)