This question is locked. New answers and comments are not allowed.
I'm trying to configure a grid to group my data based on a column and using aggregates to display the count of items for each group. I'm also showing the total count in the grid footer. I got that part working, but now I would like to show on the group footer what percentage of the total the current group count represents. So, for example, if the total count displayed in the grid footer shows that there are four records and I have a group that shows on its group footer that there are two records, I would like to show the value 50% next to the item.count for that group.
Is this even possible? Has anyone achieved this? Any ideas would be greatly appreciated.
Below is the code I'm using to declare my grid:
@(Html.Telerik().Grid(Model)
.Name("ReportGrid")
.Columns(columns =>
{
columns.Bound(t => t.MainID);
columns.Bound(t => t.Problem.ProblemTitle)
.Aggregate(aggregates => aggregates.Count())
.GroupFooterTemplate(@<text>Count: @item.Count (<<calculate the percentage value here>>% of total)</text>)
.FooterTemplate(@<text>Count: @item.Count</text>);
columns.Bound(t => t.ProblemSubCategory.ProblemSubCategoryTitle);
columns.Bound(t => t.DateOpen);
columns.Bound(t => t.DateClosed);
})
.Sortable()
.Groupable(settings =>
{
settings.Groups(groups =>
{
groups.Add(t => t.Problem.ProblemTitle);
})
.Visible(true);
})
.Filterable()
)
Thanks,
Carlos.
Is this even possible? Has anyone achieved this? Any ideas would be greatly appreciated.
Below is the code I'm using to declare my grid:
@(Html.Telerik().Grid(Model)
.Name("ReportGrid")
.Columns(columns =>
{
columns.Bound(t => t.MainID);
columns.Bound(t => t.Problem.ProblemTitle)
.Aggregate(aggregates => aggregates.Count())
.GroupFooterTemplate(@<text>Count: @item.Count (<<calculate the percentage value here>>% of total)</text>)
.FooterTemplate(@<text>Count: @item.Count</text>);
columns.Bound(t => t.ProblemSubCategory.ProblemSubCategoryTitle);
columns.Bound(t => t.DateOpen);
columns.Bound(t => t.DateClosed);
})
.Sortable()
.Groupable(settings =>
{
settings.Groups(groups =>
{
groups.Add(t => t.Problem.ProblemTitle);
})
.Visible(true);
})
.Filterable()
)
Thanks,
Carlos.