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

Setting the Operators

Updated on Sep 16, 2026

The Filter provides options for defining which filter operators will be displayed in the filtering drop-down by using the .Operators() option.

The following example demonstrates how to set the equals and contains filter operators to the string fields and the greater than and less than filter operators to the numerical fields.

Razor
<script type="text/x-kendo-template" id="itemTemplate">
    <li>
        <strong>#= Name #</strong>, aged #= Age #, is on vacation: #= IsOnLeave #
    </li>
</script>

@(Html.Kendo().DataSource<SampleData>()
    .Name("dataSource1")
    .Ajax(d=>d.Read(r => r.Action("GetPeople", "Filter")))
)

@(Html.Kendo().Filter<SampleData>()
    .Name("filter")

    .Operators(o => // Define the custom texts for the operator names and the available operators.
    {
        o.String(s =>
        {
            s.Eq("Is Exactly");
            s.Contains("Partially Matches");
        });
        o.Number(n =>
        {
            n.Gte("Older Than");
            n.Lt("Younger Than");
        });
    })

    .MainLogic(FilterCompositionLogicalOperator.And)
    .ExpressionPreview() // Shows a text preview of the filter expression.
    .ApplyButton() // Shows the built-in Apply button.
    .Fields(f => // Defining the fields is not mandatory. Otherwise, they will be taken from the data source schema.
                    // If you define the fields, their names and types must match the data source definition.
    {
        f.Add(p=>p.Name).Label("Name");
        f.Add(p=>p.Age).Label("Age");
        f.Add(p=>p.IsOnLeave).Label("On Vacation");
    })
    .FilterExpression(f => { // Defining an initial filter expression is not required.
        f.Add(p => p.Age).IsGreaterThanOrEqualTo(30);
        f.Add(p => p.Name).Contains("Doe");
    })
    .DataSource("dataSource1")
)

@(Html.Kendo().ListView<SampleData>()
    .Name("listView")
    .TagName("ul")
    .DataSource("dataSource1")
    .ClientTemplateId("itemTemplate")
)

<script>
    $(document).ready(function () {
        // Apply filtering immediately after the helper initialization because an initial filter is set.
        $("#filter").getKendoFilter().applyFilter();
    });
</script>

Custom Operators with TagHelpers

To define a custom operator with TagHelpers, nest the <filter-custom-operator> tag directly inside one of the type-specific operator tags: <filter-operators-string>, <filter-operators-number>, <filter-operators-date>, or <filter-operators-boolean>. The type-specific operator tag must be nested inside <operators>.

Razor
<kendo-filter name="filter">
    <operators>
        <filter-operators-string>
            <filter-custom-operator name="customOperator" text="Custom operator" handler="customOperatorHandler" />
        </filter-operators-string>
    </operators>
</kendo-filter>

The current TagHelper implementation supports one <filter-custom-operator> per type-specific operator tag. If you add multiple custom operator tags to the same type-specific tag, the last one replaces the preceding definitions. The fluent API also supports one custom operator per type.

See Also