If virtual scrolling is enabled aggregates work only with current data, e. g. scrolling make total value of a column change
Posted on:22 Apr 2021 17:48
The Skip and Take are always present, but if the collection you give to the grid is an IQueriable you simply don't see them happen behind the scenes. The grid creates the LINQ query for you that includes them and EF resolves it to SQL.
The article I linked offers a solution - performing the desired calculation yourself so you can apply the desired optimizations on your data source to retrieve the required data. The grid cannot and should not do this for you because it would mean pulling all the data to aggregate over it, and that has the potential to destroy the performance of your entire application, even bring it down. Thus, if you want to aggregate over all the data, you need to acknowledge the risks and optimize the queries accordingly. The grid gives you the OnRead event to use as base.
As a developer I understand, but as a user you cannot accept that scrolling a grid changes the total of the column.
What if, with an IQueryable as data source, the grid asks for the Count of the columns with aggregates without the skip/take of the virtual scroll?
Posted on:22 Apr 2021 13:49
The grid can do aggregation only over the data it has. If you use the OnRead event, its point is that the grid will not have all the data and thus aggregation cannot possibly happen for all of the data inside the grid.