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

Custom filter based on 2 property object

1 Answer 389 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 25 Mar 2014, 06:56 PM
Using the MVC wrapper, I've created a grid where one of the columns is bound to an object defined as roleId and roleName.  Using a custom editor I've been able to make that a DropDownList as shown in this example:  http://demos.telerik.com/kendo-ui/web/grid/editing-custom.html

Now I want to utilize a similar DropDownList for the filter.  I've tried various permutations of cobbled together code I've found here and there, but with no success.  What would be the best approach for this?

Thanks,
Lee

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 27 Mar 2014, 01:43 PM
Hello Lee,

Basically there are different scenarios based on your setup. You are binding the column to the complex object then the only feasible way to make it work is to use Server Operations. If you are using the MVC wrapper then you will have to implement the interfaces to be able to sort / compare such items.

An easier approach would be to avoid using such complex object and use a simple foreignKey ID like demonstrated in this demo:

http://demos.telerik.com/kendo-ui/web/grid/foreignkeycolumn.html

Thus everything will work out-of-the-box.

If you want to stick with the complex object then you will have to customize the filter menu like shown here:

http://demos.telerik.com/kendo-ui/web/grid/filter-menu-customization.html

And you will have to implement the interfaces for comparison.

When using ServerOperation(false) sorting and filtering on a complex field is not supported.

Kind Regards,
Petur Subev
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
Lee
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or