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

GridBoundColumnSortableBuilder

Methods

AllowUnsort(System.Boolean)

Sets a value determining whether the column can be unsorted or not.

Parameters

allowUnsort - System.Boolean

The a value determining whether the column can be unsorted (true) or not (false).

Example


                @(Html.Kendo().Grid(Model)
                        .Name("Grid")
                        .Columns(columns =>
                            columns.Bound(o => o.OrderDate)
                                   .Sortable(sortable =>
                                        sortable.AllowUnsort(false)
                                   )
                        ))

Compare(System.Func)

Sets a JavaScript function which is used to compare the values.

Parameters

handler - System.Func<Object,Object>

The handler.

Example


                @(Html.Kendo().Grid(Model)
                        .Name("Grid")
                        .Columns(columns =>
                            columns.Bound(o => o.OrderDate)
                                   .Sortable(sortable =>
                                        sortable.Compare(
                                            @<text>
                                            function(a, b, descending) {
                                                // compare logic
                                            }
                                            </text>
                                        )
                                   )
                        ))

Compare(System.String)

Sets a JavaScript function which is used to compare the values.

Parameters

handler - System.String

The JavaScript handler.

Example


                @(Html.Kendo().Grid(Model)
                        .Name("Grid")
                        .Columns(columns =>
                            columns.Bound(o => o.OrderDate)
                                   .Sortable(sortable =>
                                        sortable.Compare("compare")
                                   )
                        ))

InitialDirection(Kendo.Mvc.ListSortDirection)

Determines the initial sort direction.

Parameters

initialDirection - ListSortDirection

The initial sort direction.

Example


                @(Html.Kendo().Grid(Model)
                        .Name("Grid")
                        .Columns(columns =>
                            columns.Bound(o => o.OrderDate)
                                   .Sortable(sortable =>
                                        sortable.InitialDirection(ListSortDirection.Ascending)
                                   )
                        ))

In this article
Not finding the help you need?