GridBoundColumnGroupableSortBuilder
Methods
Compare(System.String)
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.
Parameters
handler - System.String
The name of the JavaScript function that will be evaluated.
RETURNS
Returns the current GridBoundColumnGroupableSortBuilder instance for method chaining.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Filterable()
.Columns(columns =>
{
columns.Bound(c => c.Name).Groupable(grp=>grp.Sort(x=>x.Compare("compareByTotal")));
}))
Compare(System.Func)
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.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag.
RETURNS
Returns the current GridBoundColumnGroupableSortBuilder instance for method chaining.
Dir(Kendo.Mvc.ListSortDirection)
Sets the sort direction when grouping.
Parameters
value - ListSortDirection
The sort direction of the list.
RETURNS
Returns the current GridBoundColumnGroupableSortBuilder instance for method chaining.
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Filterable()
.Columns(columns =>
{
columns.Bound(c => c.Name).Groupable(grp=>grp.Sort(x=>x.Dir(ListSortDirection.Ascending)));
}))