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

Possible to write a custom filter for a subset of columns?

1 Answer 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Iron
Iron
Veteran
Doug asked on 07 Apr 2021, 11:09 PM
I have a wide grid and need to write custom filters for two of the columns. I've implemented this in OnRead but is there a way to do that while allowing the default filter to run for all the other columns or do I need to write custom filters for all columns?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Apr 2021, 11:22 AM

Hi Doug,

The grid uses the first filter descriptor matching a given field to populate its UI. You can read more in the Set Grid Options Through State section of the State article, make sure to check out the second code snippet and its description. So, you can add more filter descriptors or otherwise modify the DataSourceRequest as required by your business logic and keep the grid functioning, you only have to ensure you edit the collection correctly.

There is another path you can take - you can add those filters to the DataSourceRequest object only before using it to query the database, not in the grid-related events, but in the backend.

 

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Doug
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Marin Bratanov
Telerik team
Share this question
or