I would like to change the presentation of the grid between showing 'all rows' and 'only selected rows'.I found no way to do this, maybe per filtering?I have not found the way to filter on selected/unselected.
Is there a way to do this?
Thank you in advance,Klaus
Hello Klaus,
Thank you for following up!
I have been looking into your additional question and what I could say is that it is possible to achieve your requirement by using the approach from my previous message and an IgxSwitchComponent to switch between selected/all rows modes.
What I could suggest is defining an instance of the default filtering strategy and setting it to the filterStrategy accessor of the IgxGrid when needed. Additionally, I have modified the previously attached sample and it could be found here.
On my side, everything works as expected and as could be observed in the attachment below, when filtering the data, without selecting the IgxSwitch, all matching records are shown and when selecting the ‘Show Selected’ mode of the switch, only the matching records which are selected are shown.
Please test this approach on your side and let me know if you need any further assistance regarding this matter.
Looking forward to your reply.
Sincerely, Riva Ivanova Entry Level Software Developer
Hello Riva,
thank you for your fast resopnse.Your sample ist very good and understandable.
My situation is as follows: I have placed a slider in the header of the grid, with which I want to switch the view between 'all rows' and 'selected rows'. I apologize that my description was not precise enough.I think this scenario should be accomplished by using your strategy and filtering the grid per code?Thank you for your efforts,Klaus
Thank you for posting into our community!
I have been looking into your question and an approach I could suggest is implementing your own custom filtering strategy in order to filter only the selected rows. This is achieved by setting the filterStrategy accessor of the IgxGrid.
Additionally, in order to demonstrate my suggestion, I have prepared a small sample using the above approach and it could be found here.
On my side, everything works as expected and when selecting a few rows and applying filtering, only the selected rows are filtered and displayed in the IgxGrid. This could be observed in the attachment below: