Declined
Last Updated: 30 May 2022 13:31 by ADMIN
Kevin
Created on: 25 May 2022 17:31
Category: Grid
Type: Feature Request
1
Option to filter grid by cell content instead of model field

When working with grid column templates, it would be incredibly helpful if you could filter by the content of the cell itself rather than be restricted to a field that is a part of the model. Considering that the main use case of a template is to display something in a different format from how it appears on the model I think it's fair to say that most users would then expect to be able to filter the text they see rather than some value behind the scenes.

This has been problematic for example when trying to show data from a separate object by joining on a common ID value via the template. I understand one option would be to create a separate view model for the purposes of the grid but that potentially adds additional complexity to a project just to add some basic text filtering.

One workaround I've implemented for now is to use the OnRead event to manually filter the initial collection of data for my templated columns. I use a dictionary to map id values to my desired display text and then filter using LINQ. This is workable but again adds a lot of extra steps for something that would ideally be much simpler.

Thanks,

Kevin

2 comments
ADMIN
Dimo
Posted on: 30 May 2022 13:31

Hello Kevin,

Thanks for your suggestion.

I agree that the described functionality will spare some development work if it is built-in. However, it is very infeasible and inefficient to implement such a feature out-of-the-box. I have provided some insights in the related forum thread.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Kevin
Posted on: 25 May 2022 19:19
In the following article (https://docs.telerik.com/blazor-ui/knowledge-base/grids-foreign-key), you describe one approach to this situation using templates. However because you have to assign the foreign key field to the descriptor for filtering, it limits you to one column from the foreign key table/model). For example if you have a date field and a description field, filtering by date would highlight both column filter icons.