Hi there,
I am attempting to take advantage of the grouppaging feature in the Kendo Grid as follows:
@(Html.Kendo().Grid(Model.SearchResults)
.Name("SearchResultGrid")
.Groupable()
.Columns(columns =>
{
columns.Bound(p => p.FeatureId).Title("Feature ID");
columns.Bound(p => p.FeatureName).Title("Feature name");
columns.Bound(p => p.DesignationTypeLkId).Title("Designation type");
columns.Bound(p => p.FeatureTypeName).Title("Feature type").ClientGroupHeaderTemplate("#= value # (Count: #= count#)");
columns.Bound(p => p.FeatureInstanceCount).Title("# of instances").ClientGroupHeaderColumnTemplate("Sum: #=sum#");
})
.Sortable()
.Pageable(p => p.PageSizes(true).Enabled(true))
.Pageable(pager => pager.PageSizes(new[] { 20, 50, 100 }))
.DataSource(dataSource => dataSource
.Ajax()
.GroupPaging(true)
.PageSize(20)
.ServerOperation(false)
.Aggregates(aggregates =>
{
aggregates.Add(p => p.FeatureTypeName).Count();
aggregates.Add(p => p.FeatureInstanceCount).Sum();
})
)
)
If I combine the GroupPaging setting with the Sum aggregate on FeatureInstanceCount, I get the following exception upon grouping by FeatureTypeName:
Uncaught TypeError: Cannot read properties of undefined (reading 'hasSubgroups')
at init.groupCount (kendo.all.min.js:28)
at init._calculateGroupsTotal (kendo.all.min.js:28)
at init.collapseGroup (kendo.all.min.js:64)
at HTMLAnchorElement.t._groupableClickHandler.t._groupableClickHandler (kendo.all.min.js:61)
at HTMLTableElement.dispatch (jquery.js:5429)
at HTMLTableElement.elemData.handle (jquery.js:5233)
Am I trying to do something unsupported here?
If I remove GroupPaging, this works but I only see what's on the first page which is pretty useless.
Hi Paul,
Thank you for sharing your configuration of the Grid and the error you are getting.
The encountered issue is indeed a known bug. Please review the related Bug Report groupPaging and groupHeaderColumnTemplate cause an error in the Grid. Following your report I will increase the priority of the issue.
Unfortunately, a workaround isn't available for the present issue.
Please let me know, if you have further questions.
Regards,Stoyan
Progress Telerik