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

GridSearchSettingsBuilder

Methods

Field(System.Linq.Expressions.Expression,System.String)

Defines the fields and their expressions for filtering with the Search Toolbar.

Parameters

expression - System.Linq.Expressions.Expression<Func>

An expression returning a Search field that will apply an expressionOperator.

expressionOperator - System.String

An expression returning a Search field that will apply an expressionOperator.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .ToolBar(t => t.Search())
                .Search(s =>
                {
                    s.Field(o => o.OrderID, "eq");
                    s.Field(o => o.Freight, "gt");
                    s.Field(o => o.ShipName, "contains");
                    s.Field(o => o.ShipCity, "contains");
                })
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID).Filterable(false);
                    columns.Bound(p => p.Freight);  
                })
                .Scrollable()
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )

Field(System.String,System.String)

Defines the name of the JavaScript function that will handle the ColumnMenuInit client-side event.

Parameters

memberName - System.String

A field that will apply an expressionOperator.

expressionOperator - System.String

A field that will apply an expressionOperator.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
                .Name("grid")
                .ToolBar(t => t.Search())
                .Search(s =>
                {
                    s.Field("OrderID", "eq");
                    s.Field("Freight", "gt");
                    s.Field("ShipName", "contains");
                    s.Field("ShipCity", "contains");
                })
                .Columns(columns =>
                {
                    columns.Bound(p => p.OrderID).Filterable(false);
                    columns.Bound(p => p.Freight);  
                })
                .Scrollable()
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(20)
                    .Read(read => read.Action("Orders_Read", "Grid"))
                )
            )

In this article
Not finding the help you need?