Declined
Last Updated: 22 Apr 2021 17:48 by ADMIN
Marco
Created on: 22 Apr 2021 12:48
Category: Grid
Type: Bug Report
0
Aggregates with Virtual Scrolling
If virtual scrolling is enabled aggregates work only with current data, e. g. scrolling make total value of a column change
3 comments
ADMIN
Marin Bratanov
Posted on: 22 Apr 2021 17:48

Hello Marco,

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.

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Marco
Posted on: 22 Apr 2021 15:30

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?

 

ADMIN
Marin Bratanov
Posted on: 22 Apr 2021 13:49

Hi Marco,

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.

You can read more about this behavior and see how you can add grand totals in the footers in your own code in the Notes section of the Footer Template article: https://docs.telerik.com/blazor-ui/components/grid/templates/column-footer#notes.

With this in mind, I must mark this as "declined" because this behavior is expected and documented, and it cannot be changed.

Regards,
Marin Bratanov
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.