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

FilterBuilder

Properties

WriteAction - Func

Methods

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>

Example


               @(Html.Kendo().Filter<ProductViewModel>()
                   .Name("filter")
                   .Fields(fields =>
                   {
                        fields.Add(field => field.ProductName).Label("ProductName");
                   })
                   .FilterExpression(expression =>
                   {
                       expression.Add(filter => filter.ProductName).IsGreaterThanOrEqualTo(5);
                   })
               )

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

Example


                @{

                    FilterDescriptor filterDescriptor = FilterDescriptor()
                    {
                       Member = "ProductName",
                       CaseSensitiveFilter = true,
                       Value = "Chai",
                       MemberType = typeof(string),
                       Operator = FilterOperator.IsEqualTo
                    };

                    CompositeFilterDescriptor compositeFilterDescriptor = new CompositeFilterDescriptor()
                    {
                        FilterDescriptors = new FilterDescriptorCollection
                        {
                            filterDescriptor
                        },
                        CaseSensitiveFilter = true,
                        LogicalOperator = FilterCompositionLogicalOperator.Or
                    };
                }


                @(Html.Kendo().Filter<ProductViewModel>()
                    .Name("filter")
                    .Fields(fields =>
                    {
                         fields.Add(product => product.ProductName).Label("ProductName");
                    })
                    .FilterExpression(@compositeFilterDescriptor)
                )

Operators(System.Action)

The text of the filter operators displayed in the filter.

Parameters

configurator - System.Action<FilterOperatorsSettingsBuilder>

The configurator for the operators setting.

Example


               @(Html.Kendo().Filter<ProductViewModel>()
                   .Name("filter")
                   .Fields(fields =>
                   {
                        fields.Add(field => field.ProductName).Label("ProductName");
                   })
                   .Operators(operators =>
                        {
                            operators.String(s =>
                                {
                                     s.Contains("Contains")
                                      .Startswith("Starts with")
                                      .Endswith("Ends with")
                                      .Eq("Equals")
                                      .Neq("Does not equal")
                                      .Isnull("Is null")
                                      .Isnotnull("Is not null")
                                      .Isnotempty("Is not empty")
                                      .Isnullorempty("Is null or empty")
                                      .Isnotnullorempty("Is not null or empty")
                                      .Contains("Contains")
                                      .Doesnotcontain("Does not contain");
                                }
                            );
                        }
                    )
                   .FilterExpression(filter =>
                   {
                       filter.Add(field => field.ProductName).Contains("cha");
                   })
               )

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 for ApplyButton

ApplyButton()

If set to true the filter will display a button which when clicked will apply filtering over the datasource.

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

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 for ExpressionPreview

ExpressionPreview()

If set to true the filter will visualize the filter expression that will be applied to the datasource.

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.

MainLogic(Kendo.Mvc.FilterCompositionLogicalOperator)

Defines the value of the logical operator at the root level of the filter expression.

Parameters

value - FilterCompositionLogicalOperator

The value for MainLogic

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 configurator for the messages setting.

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")
                  )
            )

ToComponent()

Returns the internal view component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The HTML attributes.

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

Render()

Renders the component in place.

ToHtmlString()

WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

Parameters

writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder

ToClientTemplate()

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean
In this article
Not finding the help you need?