# 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).

#### RETURNS

Returns the current [GridBoundColumnSortableBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/gridboundcolumnsortablebuilder) instance for method chaining.

#### 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.

#### RETURNS

Returns the current [GridBoundColumnSortableBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/gridboundcolumnsortablebuilder) instance for method chaining.

#### 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.

#### RETURNS

Returns the current [GridBoundColumnSortableBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/gridboundcolumnsortablebuilder) instance for method chaining.

#### 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](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc/listsortdirection)

The initial sort direction.

#### RETURNS

Returns the current [GridBoundColumnSortableBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/gridboundcolumnsortablebuilder) instance for method chaining.

#### Example

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