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

Defines the fluent API for groupable.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class GridBoundColumnGroupableSortBuilder

Inheritance: objectGridBoundColumnGroupableSortBuilder

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

Constructors

GridBoundColumnGroupableSortBuilder method.

C#
public GridBoundColumnGroupableSortBuilder(GridBoundColumnGroupableSortSettings container)
Parameters:containerGridBoundColumnGroupableSortSettings

Properties

Gets the settings being configured.

C#
protected GridBoundColumnGroupableSortSettings Container { get; }

Methods

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.

C#
public GridBoundColumnGroupableSortBuilder Compare(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

GridBoundColumnGroupableSortBuilder

Returns the current GridBoundColumnGroupableSortBuilder instance for method chaining.

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.

C#
public GridBoundColumnGroupableSortBuilder Compare(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

GridBoundColumnGroupableSortBuilder

Returns the current GridBoundColumnGroupableSortBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Filterable()
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Name).Groupable(grp=&gt;grp.Sort(x=&gt;x.Compare("compareByTotal")));
}))

Sets the sort direction when grouping.

C#
public GridBoundColumnGroupableSortBuilder Dir(ListSortDirection value)
Parameters:valueListSortDirection

The sort direction of the list.

Returns:

GridBoundColumnGroupableSortBuilder

Returns the current GridBoundColumnGroupableSortBuilder instance for method chaining.

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("grid")
.Filterable()
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Name).Groupable(grp=&gt;grp.Sort(x=&gt;x.Dir(ListSortDirection.Ascending)));
}))