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

Grid CheckBoxList Filter - Auto "Select All" upon entering filter criteria

1 Answer 210 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aditya
Top achievements
Rank 1
Veteran
Aditya asked on 08 Mar 2021, 07:15 PM

This is related to Grid CheckBoxList Filter - https://demos.telerik.com/blazor-ui/grid/filter-checkboxlist

 

In Microsoft Excel, when we start typing in the Search box, the matching entries along with "Select All" are already checked. So upon typing the required criteria, the user just needs to select Ok button to view the filtered results.

 

 

 

In the case of Blazor Grid, the matching entries and Select All option are not checked automatically. So the user would need to do an additional action of checking "Select All". Please refer to the attached screenshots.

 

 

Is there a way to have "Select All" auto checked upon typing the filter criteria?

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 08 Mar 2021, 07:28 PM

Hello Aditya,

An extremely important difference between Excel and a web grid is that Excel starts with all the data available at once, locally, in a desktop application that can take a much more serious performance hit without the user noticing than a web app could. I think this is why they start with all the filter options checked. In the web things work the other way around because every time you filter (or do other data operations), you have to request data anew (in the common case) and that is a slow, expensive operation (if nothing else, it involves the transmit time over the wire). Thus, the checkboxes in the grid must start with the unchecked state and require an explicit action from the user to get checked.

In the UI for Blazor grid, filtering the options is supposed to only filter them. If it also selected them that would change the state and if the user wanted something else they would have to wade through the options and uncheck them manually. Since filtering and selecting checkboxes are two separate actions, the grid must not perform both of them at the same time, this makes the action (typing in the filter box) ambiguous - should the list be filtered, should items be selected, should the grid also get filtered? Finally, if selecting those checkboxes should filter the grid, that can cause a data request and delay which is not something that would be expected of the filter menu until you click Filter.

If you want to change the built-in behavior, you can use the FilterTemplate to implement your own checklist filter that behaves in the way you want it to. You can start from the examples here and here and also review how the grid builds filter expressions here. So, in your custom template code you can add items to the grid state to populate checkboxes if you wish to do so. I must note, however, that calling .SetState() will make a data request, which might not be expected by the end user. For this, and the reasons explained above, this is not something we can support out of the box.

Regards,
Marin Bratanov
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/.

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