GridBoundColumnFilterableBuilder

Methods

UI(Kendo.Mvc.UI.GridFilterUIRole)

Sets the type of the input element of the filter menu

Parameters

role - GridFilterUIRole

The filter role.

Example

Razor
 
                   @(Html.Kendo().Grid(Model)
                    .Name("grid")
                    .Columns(columns =>
                    {
                        columns.Bound(c => c.Name).Filterable(ftb=>ftb.UI(GridFilterUIRole.DatePicker));
                    }))
             

Cell(System.Action)

Configures the column filter cell

Parameters

configurator - System.Action<GridColumnFilterableCellSettingsBuilder>

The configuration of the cell.

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.Cell(c=>c.SuggestionOperator(FilterType.StartsWith)));
                   }))
             

UI(System.Func)

Sets JavaScript function which to modify the UI of the filter input.

Parameters

handler - System.Func<Object,Object>

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.UI(@<text>JavaScript function goes here</text>));
                   }))
             

UI(System.String)

Sets JavaScript function which to modify the UI of the filter input.

Parameters

handler - System.String

JavaScript function name

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.UI("UIHandler"));
                   }))
             

ItemTemplate(System.String)

Sets the template for the checkbox rendering when Multi checkbox filtering is enabled

Parameters

handler - System.String

The name of the handler that returns the template.

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.ItemTemplate("jsHandler"));
                   }))
             

Multi(System.Boolean)

Enables / disabled the Multi Checkbox filtering support for this column.

Parameters

value - System.Boolean

If 'true' - Multi Checkbox filtering is enabled, if 'false' Multi Checkbox filtering is disabled.

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.Multi(true));
                   }))
             

Search(System.Boolean)

Controls whether to show a search box when checkbox filtering is enabled.

Parameters

value - System.Boolean

If 'true' - search is enabled, if 'false' search is disabled.

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.Search(true));
                   }))
             

IgnoreCase(System.Boolean)

Toggles between case-insensitive (default) and case-sensitive searching.

Parameters

value - System.Boolean

If 'true' - ignore the case, otherwise - not.

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.IgnoreCase(true));
                   }))
             

BindTo(System.Collections.IEnumerable)

Provide IEnumerable that will be used as DataSource for Multi CheckBox filtering on this column

Parameters

dataSource - System.Collections.IEnumerable

Data of the DataSource

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Filterable()
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.Multi(true).BindTo(new object[] { new { Name = "Name1" }, new { Name = "Name2" } }));
                   }))
             

CheckAll(System.Boolean)

Enables / disabled the CheckAll checkboxes when Multi Checkbox filtering is enabled.

Parameters

value - System.Boolean

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Filterable()
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb=>ftb.Multi(true).CheckAll(true));
                   }))
             

DataSource(System.Action)

Configures the DataSource options.

Parameters

configurator - System.Action<ReadOnlyDataSourceBuilder>

The DataSource configurator action.

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                .Name("grid")
                   .Filterable()
                   .Columns(columns =>
                               columns.Bound(o => o.Name)
                                       .Filterable(filterable =>
                                            filterable.Cell(cell =>
                                                   cell.DataSource(ds =>
                                                        ds.Read("someAction", "someController"))))))
             

DataSource(System.String)

Sets the id/name of the used DataSource.

Parameters

DataSourceId - System.String

The DataSource object ID.

Example

Razor
 
               @(Html.Kendo().Grid(Model)
                   .Name("grid")
                   .Filterable()
                   .Columns(columns =>
                   {
                       columns.Bound(c => c.Name).Filterable(ftb => ftb.DataSource("dataSourceId"));
                   }))
             

Enabled(System.Boolean)

Enables or disables filtering

Parameters

value - System.Boolean

True to set the Filterable functionality

Example

Razor
 
            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID).Filterable(false);
                    columns.Bound(p => p.Freight);  
                })
                .Filterable(f => f.Enabled(true))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )
              

Operators(System.Action)

Configures the Filter menu operators.

Parameters

configurator - System.Action<FilterableOperatorsBuilder>

The text of the filter operators displayed in the filter menu.

Example

Razor
 
            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID).Filterable(false);
                    columns.Bound(p => p.Freight);  
                })
                .Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                    .ForString(str => str.Clear()
                        .StartsWith("Starts with")
                        .IsEqualTo("Is equal to")
                        .IsNotEqualTo("Is not equal to")
                    ))
                )
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )
              

Messages(System.Action)

Configures Filter menu messages.

Parameters

configurator - System.Action<FilterableMessagesBuilder>

Configure the options for the Messages in the Filter

Example

Razor
 
            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID).Filterable(false);
                    columns.Bound(p => p.Freight);  
                })
                .Filterable(f => f.Messages(m => m.And("And").Or("Or").Filter("Apply filter").Clear("Clear filter")))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )
              

Extra(System.Boolean)

Specify if the extra input fields should be visible within the filter menu. Default is true.

Parameters

value - System.Boolean

True to show the extra inputs, otherwise false

Example

Razor
 
            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID).Filterable(false);
                    columns.Bound(p => p.Freight);  
                })
                .Filterable(f => f.Extra(false))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )
              

Mode(Kendo.Mvc.UI.GridFilterMode)

Specify the filter mode - you can choose between having separate header row and the filter menu available by clicking the icon. Default is the filter menu. Multiple filter modes can be set by combining the flags:

Parameters

value - GridFilterMode

If set to Row the user would be able to filter via extra row added below the headers. By default filtering is using the Menu mode.

Example

Razor
 
            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID).Filterable(false);
                    columns.Bound(p => p.Freight);  
                })
                .Filterable(f => f.Mode(GridFilterMode.Menu))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )