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.