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

Column filter dropdownlist containing available values

1 Answer 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 01 Nov 2013, 01:02 PM
Hello,

I see how to specify a dropdownlist for a column filter, however it appears to require a data source for the list items. Is it possible to specify that this data source be the unique values in the column being filtered on?

Thanks,
Gary

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 01 Nov 2013, 01:29 PM
Hello Gary,


To achieve this you should manually handle the back end and return the distinct values for the specified column. For example in the MVC Filter menu customization demo, here is the controller action, that we are using for the cities column:
public ActionResult FilterMenuCustomization_Cities()
{
    var db = new NorthwindDataContext();
    return Json(db.Employees.Select(e => e.City).Distinct(), JsonRequestBehavior.AllowGet);
}

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Gary
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or