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

Defines the fluent API for configuring GridSortableSettings

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class GridSortableSettingsBuilder<T> where T : class

Inheritance: objectGridSortableSettingsBuilder<T>

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 GridSortableSettingsBuilder<T> class.

C#
public GridSortableSettingsBuilder(GridSortableSettings<T> container)
Parameters:containerGridSortableSettings<T>

The GridSortableSettings<T>.

Properties

Gets or sets the Container.

C#
protected GridSortableSettings<T> Container { get; }

Methods

If set to true the user can get the grid in unsorted state by clicking the sorted column header.

C#
public GridSortableSettingsBuilder<T> AllowUnsort(bool value)
Parameters:valuebool

The value for AllowUnsort

Returns:

GridSortableSettingsBuilder<T>

Returns the current GridSortableSettingsBuilder<T> instance.

Enables or disables sorting.

C#
public virtual GridSortableSettingsBuilder<T> Enabled(bool value)
Parameters:valuebool

If set to true the user could sort the grid by clicking the column header cells. By default sorting is disabled.

Returns:

GridSortableSettingsBuilder<T>

Returns the current GridSortableSettingsBuilder<T> instance for method chaining.

Example:
C#
@(Html.Kendo().Grid&lt;OrderViewModel&gt;()
.Name("grid")
.Columns(columns =&gt;
{
columns.Bound(p =&gt; p.OrderID).Filterable(false);
columns.Bound(p =&gt; p.Freight);
})
.Sortable(s =&gt; s.Enabled(true))
.Scrollable()
.DataSource(dataSource =&gt; dataSource
.Ajax()
.PageSize(20)
.Read(read =&gt; read.Action("Orders_Read", "Grid"))
)
)

Determines the inital (from un-sorted to sorted state) sort direction. The supported values are asc and desc.

C#
public GridSortableSettingsBuilder<T> InitialDirection(string value)
Parameters:valuestring

The value for InitialDirection

Returns:

GridSortableSettingsBuilder<T>

Returns the current GridSortableSettingsBuilder<T> instance.

If set to true the user will see sort sequence indicators for sorted columns.

C#
public GridSortableSettingsBuilder<T> ShowIndexes(bool value)
Parameters:valuebool

The value for ShowIndexes

Returns:

GridSortableSettingsBuilder<T>

Returns the current GridSortableSettingsBuilder<T> instance.

Defines the sort modes supported by Kendo UI Grid for ASP.NET MVC

C#
public GridSortableSettingsBuilder<T> SortMode(GridSortMode value)
Parameters:valueGridSortMode

The value for SortMode

Returns:

GridSortableSettingsBuilder<T>

Returns the current GridSortableSettingsBuilder<T> instance.