Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datagrid filtered table with number that shows the number of rows filtered #2055

Open
louaid opened this issue Sep 4, 2024 · 1 comment
Open
Labels
data grid Data grid component waiting for customer response Cannot make further progress until the customer responds.

Comments

@louaid
Copy link

louaid commented Sep 4, 2024

Use case

We are trying to show the user how many rows are available in the datagrid table when filtered. I was able to do show number of row in table by datasource.length as a string at the bottom of the table. But the issue is when the user filters the table. The number of rows is not updated.

Proposal

when user filter the datagrid table in flutter we need to have a value in the footer for example that tells us how many rows are visible after the filter.

@abineshPalanisamy
Copy link

Hi @louaid ,

In SfDataGrid, we can fetch the total row count, even when filtering is applied, by using DataGridSource.effectiveRows. By utilizing WidgetsBinding.instance.addPostFrameCallback in the initState, the row count is updated once the DataGrid has completed its initial build. The onFilterChanged callback is used to update the row count in the UI whenever filtering is applied. The footer of the SfDataGrid can be used to display the total row count, with an additional row that can be displayed under the last row .

We have included a sample for your reference. Please review it for more details and adapt it to suit your specific requirements.

Regards,
Abinesh P

@LavanyaGowtham2021 LavanyaGowtham2021 added data grid Data grid component waiting for customer response Cannot make further progress until the customer responds. labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data grid Data grid component waiting for customer response Cannot make further progress until the customer responds.
Projects
None yet
Development

No branches or pull requests

3 participants