Checkbox Filter menu

1 Answer 71 Views
Filter  Grid Menu
Layla
Top achievements
Rank 1
Layla asked on 30 Jul 2024, 08:17 PM | edited on 31 Jul 2024, 07:23 PM

Hi there! We are using GridColumnMenuCheckboxFilter to filter a numeric column for a field called "fruits" in our data grid. The filtering works fine, but we would like to see the checkbox filter menu display a different label name, conditionally.

For example, if we have the checkbox filter menu showing the options(checkbox label) as numeric values -1, 0, 1. Please see attached image.

Is it possible to update the text for the checkbox label? like if the value for "fruits" = -1 then display the label as "Apples",  if the value for "fruits" = 0 then display the label as "Oranges",  or if the value for "fruits" = 1 display as "Bananas", etc?

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 01 Aug 2024, 07:16 PM

Hello Layla,

I have to say that there is no built-in option for changing the values in the GridColumnMenuCheckboxFilter and this is mainly due to the fact that by default, the end user will see the field values in the columns and it would be expected to have the same values in the checkbox filter menu.

However, it is possible to manually map the values before setting them to the GridColumnMenuCheckboxFilter and then manually convert them back when the filter is applied. I have an example that adds a currency symbol to numeric values (which is a modification of the values) and converts them back to numeric values when the filter is applied:

I would personally recommend to have separate field to which you can bind the column that will have the string values.

 

Regards,
Konstantin Dikov
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Tags
Filter  Grid Menu
Asked by
Layla
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or