Lasantha Bandara
Lasantha Bandara

Reputation: 809

Kendo Grid - Customize Filter Row

there is a feature called "Filter Row" in Kendo Grid

http://demos.telerik.com/kendo-ui/grid/filter-row

I want to add a drop-down list instead of a text box or a number box, to the filter box. It's for filtering a column that has countries. So I want list of countries in a drop-down list. How can I do this?

Upvotes: 3

Views: 11013

Answers (2)

Ionut Radu
Ionut Radu

Reputation: 29

As Pluc mentioned earlier valuePrimitive: true will help you create a custom filter for your grid/columns to send id's to your controller, if you are not using setting this property true you will receive an Object in your controller instead of a number, the conversion will not be made automatically . This is still working as of 2019

Upvotes: 0

Pluc
Pluc

Reputation: 2929

It's very similar to the custom Filter Menu (http://demos.telerik.com/kendo-ui/grid/filter-menu-customization). I made the mistake of no using valuePrimitive: true. You might not want it in your situation but keep that in mind.

Here's a sample: http://dojo.telerik.com/OKaS

Also, the filter menu should take up the editor model of the column but it's not always what you want.

Edit

Starting from 2014 Q2 SP1, the template function now receives an object containing "datasource" and "element". In my example, you would have to change the dropdown initialization from "container.kendoDropDownList" to "container.element.kendoDropDownList". The datasource is empty in my example but I'm assuming this can be used to pass the choices to a control without requiring another datasource or to externalize your current. I have not experimented with this feature but I suggest you do before taking my sample blindly.

Upvotes: 7

Related Questions