Multi Value Grid Filtering

0 Answers 40 Views
Grid
Justin
Top achievements
Rank 1
Iron
Justin asked on 20 Dec 2023, 07:54 PM
I'm working on implementing multi checkbox grid filtering in a project. I have a requirement where I need to have a different value for the display text than the value that is filtered on. I'm basically looking for the properties dataTextField and dataValueField  that are found on other controls such as a multiselect. Using this example to explain further; how do I use the multi checkbox filter to filter on the Category field by CategoryID but still display the CategoryName as the filter display?
Nikolay
Telerik team
commented on 25 Dec 2023, 10:11 AM

Hi Justin,

Could you please elaborate on clarifying the case? I am not sure I understand it correctly.

Having the current Dojo example:

 What property is the column in question bound to? The Category column is currently bound to Category.CategoryName property and the filtering happens by the same CategoryName property.

If you bind the column to the object Category, you will lose the filtering as the Grid is designed to work with flat data such as strings, integers, dates, booleans, and so on. To overcome this you would have to remove the default filtering and create a custom one on click of the filter button which I do not recommend as it might lead to unexpected behavior.

Regards,

Nikolay

 

Justin
Top achievements
Rank 1
Iron
commented on 29 Dec 2023, 03:25 PM

The kendoGrid is bound to a SharePoint list. I'm using SharePoint "Lookup" column types. A lookup column has an Id and Value property. I need to filter on the Id property internally but want to display the Value property as the filter to the user. So in the Dojo example, the Category is bound to the Category.CategoryName property but when the user selects a filter, the filter is applied to the Category.CategoryId property. I'm guessing this isn't possible?
Martin
Telerik team
commented on 03 Jan 2024, 02:00 PM

Hello, Justin,

Please refer to the modified Dojo example. The CategoryName is displayed in the Grid, but the CategoryIDs will be displayed in the Filter popup. Let me know if that is what you are looking for.

Justin
Top achievements
Rank 1
Iron
commented on 03 Jan 2024, 09:06 PM

Perfect! That's exactly what I was looking for.
Justin
Top achievements
Rank 1
Iron
commented on 04 Jan 2024, 08:48 PM

Is it possible to do something similar with an autocomplete control? In this example the Category column should filter on the CategoryID property but display the CategoryName as the filter text.
Martin
Telerik team
commented on 08 Jan 2024, 12:06 PM

Hello, Justin,

Could you please check the modified example and let me know if it behaves as expected?

Justin
Top achievements
Rank 1
Iron
commented on 08 Jan 2024, 02:01 PM

That works. Thanks!

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Iron
Share this question
or