This is a migrated thread and some comments may be shown as answers.

Using Grouping with custom paging

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matthias Schuster
Top achievements
Rank 1
Matthias Schuster asked on 23 Jul 2009, 01:53 PM

As documented:

"There is no universal mechanism for grouping when custom paging is allowed. The reason for this is that with the custom paging mechanism you fetch only a part of the whole information from the grid data source. Thus, when the grouping event is triggered, the grid is restricted in operating with a limited subset of the entire available data and is not able to group the items accurately. Furthermore, the aggregate functions as Count, Sum, etc. (covering operations with the whole set of grid items) may return incorrect results.

Grouping with custom paging is still possible, but it has several limitations:

  • The data that the grid binds to has to be sorted. If it is not, you may see different members of a group "grouped" to different pages when they appear at different locations in the data source.
  • The aggregate functions will not work correctly for groups that span several pages. There is no way to calculate aggregate values for the entire group when we only work with a single page of data. It is best not to use aggregate functions at all when using grouping together with custom paging. If aggregates are important to you, reduce the data source size and disable custom paging."

Hint:
It would be possible if there were an event (like the NeedDataSource) which is called "NeedGroupTotals" or similiar which provides the needed EventArgs to perform an extra call to the database.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 28 Jul 2009, 03:38 PM
Hello Matthias,

Attached to this message is a simple working project which handles the desired functionality. Give it a try
and let me know if you need additional assistance.

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Matthias Schuster
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or