FilterBuilder
Defines the fluent API for configuring the Kendo Filter for ASP.NET MVC.
Methods
ApplyButton(System.Boolean)
If set to true the filter will display a button which when clicked will apply filtering over the datasource.
Parameters
value - System.Boolean
The value that configures the applybutton.
ExpressionPreview(System.Boolean)
If set to true the filter will visualize the filter expression that will be applied to the datasource.
Parameters
value - System.Boolean
The value that configures the expressionpreview.
MainLogic(Kendo.Mvc.FilterCompositionLogicalOperator)
Defines the value of the logical operator at the root level of the filter expression.
Parameters
value - FilterCompositionLogicalOperator
The value that configures the mainlogic.
Operators(System.Action)
The text of the filter operators displayed in the filter.
Parameters
configurator - System.Action<FilterOperatorsSettingsBuilder>
The configurator for the operators setting.
Fields(System.Action)
The configuration of the filter fields. An array of JavaScript objects that hold information regarding the filter field, it's editor, default values used for filter and etc.
Parameters
configurator - System.Action<FilterFieldFactory>
The configurator for the fields setting.
DataSource(System.String)
The data source to which the widget will apply a filter. Should be an existing kendo.data.DataSource instance.
Parameters
value - System.String
The value for DataSource
ApplyButton()
If set to true the filter will display a button which when clicked will apply filtering over the datasource.
FilterExpression(Kendo.Mvc.CompositeFilterDescriptor)
An object which represents a filter expression which the kendo.data.DataSource can use to filter the data.
Parameters
value - CompositeFilterDescriptor
The value for Expression
ExpressionPreview()
If set to true the filter will visualize the filter expression that will be applied to the datasource.
FilterExpression(System.Action)
An object which represents a filter expression which the kendo.data.DataSource can use to filter the data.
Parameters
configurator - System.Action<DataSourceFilterDescriptorFactory>
Events(System.Action)
Configures the client-side events.
Parameters
configurator - System.Action<FilterEventBuilder>
The client events action.
Example
@( Html.Kendo().Filter()
.Name("Filter")
.Events(events => events
.Change("onChange")
)
)
Messages(System.Action)
The text messages displayed in the filter. Use it to customize or localize the filter messages.
Parameters
configurator - System.Action<FilterMessagesSettingsBuilder>
The action that configures the messages.
ToComponent()
Returns the internal view component.
Name(System.String)
Sets the name of the component.
Parameters
componentName - System.String
The name of the component.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Deferred(System.Boolean)
Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean)
Parameters
deferred - System.Boolean
ModelMetadata(System.Web.Mvc.ModelMetadata)
Uses the Metadata of the Model.
Parameters
modelMetadata - System.Web.Mvc.ModelMetadata
The metadata set for the Model
HtmlAttributes(System.Object)
Sets the HTML attributes.
Parameters
attributes - System.Object
The HTML attributes.
HtmlAttributes(System.Collections.Generic.IDictionary)
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
AsChildComponent()
Render()
Renders the component.
Example
@(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
@( Html.Kendo().Grid(Model)
.Name("grid")
.DetailTemplate(product => {
)
Product Details:
<div>Product Name: @( product.ProductName )</div>
<div>Units In Stock: @( product.UnitsInStock )</div>
@(
})
.Render();
)