Skip to content

Infragistics Community Forum / Web / Ignite UI for React / Data Grid – How can I get the filtered rows?

Data Grid – How can I get the filtered rows?

New Discussion
Charles Cymbor
Charles Cymbor asked on Apr 23, 2021 11:44 PM

Is there a way to get the rows that are currently shown in the grid (after filters have been applied)?

Use case: I would like to provide a way to ‘Select All’ rows after applying a filter.

Sign In to post a reply

Replies

  • 0
    Charles Cymbor
    Charles Cymbor answered on Apr 9, 2021 7:21 PM

    I found the rows in the debugger in gridRef.actualDataSource.c2.a4._inner 

    Is there a public API to get to those rows?

    • 0
      Michael DiFilippo
      Michael DiFilippo answered on Apr 9, 2021 11:18 PM

      Hello Charles, 

      I am gathering more intel from our development team. Thanks for your patience.

      • 0
        Michael DiFilippo
        Michael DiFilippo answered on Apr 9, 2021 11:33 PM

        I heard back!

        While there is no direct collection you can use the following properties off of actualDataSource to perform your own loop and gather the items after filtering. 

        eg. 

        public onFilterTextChanged = (eany=> {
                this.filterText = e.target.value;
                this.setState({filterTexte.target.value});
                this.applyFilter();
                
                for (let i = this.grid.actualDataSource.firstVisibleIndexRequestedi < this.grid.actualDataSource.lastVisibleIndexRequestedi++) {
                    console.log(this.grid.actualDataSource.getItemAtIndex(i));
                }
            }
        This was tested with or filtering sample
      • 0
        Charles Cymbor
        Charles Cymbor answered on Apr 22, 2021 6:56 PM

        Hi Michael, 

        I thought this was working but it actually only works for what is visible on the screen. I need to get all the rows that are currently in the table after filtering.

      • 0
        Charles Cymbor
        Charles Cymbor answered on Apr 23, 2021 11:44 PM

        This works for getting all the filtered row:

        for (let i = 0i < grid.actualDataSource.actualCounti++) {
                const item = grid.actualDataSource.getItemAtIndex(i);
        }
  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Charles Cymbor
Favorites
0
Replies
5
Created On
Apr 23, 2021
Last Post
4 years, 10 months ago

Suggested Discussions

Created by

Created on

Apr 23, 2021 11:44 PM

Last activity on

Feb 27, 2026 3:06 PM