This is a migrated thread and some comments may be shown as answers.

GRID Serverbinding Filter MultiCheckbox with Search

3 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 14 Mar 2019, 04:28 PM

    Serverbound grid

  • Trying to get the multicheckbox filter to work correctly
  • Additionally would like to be able to have a search function
  • Similar to the ajax multicheckbox filter: https://demos.telerik.com/aspnet-mvc/grid/filter-multi-checkboxes

    Problem:
  • While doing a serverbound grid, it seems that .Filterable(ftb => ftb.Multi(true).Search(true)) does not work
  • When clicking on the filter icon, it causes the application to do a server call via an anchor link, so it does not allow the user to use the multi-checkbox filter

3 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 18 Mar 2019, 02:25 PM
Hello Joel,

By default, the multi checkbox filtering will use the Grid's DataSource and with server binding you will have to define a separate DataSource for the unique values for the Multi filtering that will be requested with AJAX request:
@model IEnumerable<Kendo.Mvc.Examples.Models.Employee>
 
@{ Html.Kendo().Grid(Model)
    .Name("Employees")
    .Columns(columns =>
    {
        columns.Bound(e => e.FirstName).Width(140).Filterable(ftb => ftb.Multi(true).Search(true)
                    .DataSource(ds => ds.Read(r => r.Action("Unique", "Grid").Data("{ field: 'FirstName' }"))));

public ActionResult Unique(string field)
{
    var result = GetEmployees().Distinct(new EmployeeComparer(field)); 
 
    return Json(result, JsonRequestBehavior.AllowGet);
}

Give this a try and let us know if further assistance is needed.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Joel
Top achievements
Rank 1
answered on 18 Mar 2019, 04:45 PM

Hey Konstantin,

Is it possible to get a working example so I can compare the example against my current code?

Preferably on a Kendo Dojo?

Thank you,

Joel H Jan

0
Konstantin Dikov
Telerik team
answered on 19 Mar 2019, 09:03 AM
Hello Joel,

The dojo is used for jQuery examples and it could not be used for UI for ASP.NET MVC helpers. Nevertheless, you could take a look at the following online demo, which could also be tested in the offline demos application:
The second Grid in the demo is the one that uses custom DataSource for the columns filter. The only difference in your example will be the server binding of the Grid.

Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Joel
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Joel
Top achievements
Rank 1
Share this question
or