New to Telerik UI for ASP.NET MVCStart a free 30-day trial

Filtering Overview

The ASP.NET MVC MultiSelect provides options for filtering its data and displaying only a subset of the data.

Server Filtering

When using Server Filtering a reduced portion of the whole dataset is returned from the server. Displaying a subset of the whole data is useful when working with large datasets containing thousands of records. In such cases, you can improve the performance and loading times by defining a minimum filter length by using the MinLength option. For example, if you set MinLength to 3, the UI for ASP.NET MVC MultiSelect will not send a request to the remote endpoint and start the filtering process until the user enters at least three characters.

When you apply server filtering, only the source of the MultiSelect is filtered. To page and filter the dataset, use the virtualization feature.

To configure the UI for ASP.NET MVC MultiSelect for Server Filtering:

  1. Set the ServerFiltering option of the DataSource component to true.
  2. Set the Filter property of the MultiSelect.

The following example demonstrates how to configure MultiSelect for Server Filtering.

Razor
    @(Html.Kendo().MultiSelect()
          .Name("products")
          .DataTextField("ProductName")
          .DataValueField("ProductID")
          .Filter(FilterType.Contains)
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("ServerFiltering_GetProducts", "MultiSelect");
              })
              .ServerFiltering(true);
          })
    )

Client Filtering

For smaller sets of data, the UI for ASP.NET MVC MultiSelect also supports Client Filtering. To configure it, set the ServerFiltering property to false. This way the MultiSelect dataset will be filtered on the client without sending additional requests to remote endpoint.

Razor
    @(Html.Kendo().MultiSelect()
          .Name("products")
          .DataTextField("ProductName")
          .DataValueField("ProductID")
          .Filter(FilterType.Contains)
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("ServerFiltering_GetProducts", "MultiSelect");
              })
              .ServerFiltering(false);
          })
    )

See Also

In this article
Server FilteringClient FilteringSee Also
Not finding the help you need?
Contact Support