Hi,
I am trying to show SUM buy using grid aggregates but not able to display the SUM and also not able to display the 'GroupFooterTemplate' in my grid.
Below is my code :-
@(
Html.Telerik().Grid<CPX.Data.ViewModels.ReportsDetailsList>()
.Name("grdReportsList2")
.Columns(columns =>
{
columns.Bound(x => x.ClientName);
columns.Bound(x => x.InvoiceNo);
columns.Bound(x => x.Amount31To60).Format("{0:C}").Title("31-60 days")
.Aggregate(aggregates => aggregates.Sum())
.FooterTemplate(@<text> Total 31-60 days : @item.Sum.Format("{0:C}") </text>)
.GroupFooterTemplate(@<text> Total 31-60 days : @item.Sum.Format("{0:C}") </text>);
columns.Bound(x => x.Amount61To90).Format("{0:C}").Title("61-90 days")
.Aggregate(aggregates => aggregates.Sum())
.FooterTemplate(@<text> Total 61-90 days : @item.Sum.Format("{0:C}") </text>)
.GroupFooterTemplate(@<text> Total 61-90 days : @item.Sum.Format("{0:C}") </text>);
columns.Bound(x => x.AmountAbv90).Format("{0:C}").Title("Above 90 days")
.Aggregate(aggregates => aggregates.Sum())
.FooterTemplate(@<text> Total Above 90 days : @item.Sum.Format("{0:C}") </text>)
.GroupFooterTemplate(@<text> Total Above 90 days : @item.Sum.Format("{0:C}") </text>);
columns.Bound(x => x.AmountTotal).Format("{0:C}").Title("Total Amount")
.Aggregate(aggregates => aggregates.Sum())
.FooterTemplate(@<text> Total Amount : @item.Sum.Format("{0:C}") </text>)
.GroupFooterTemplate(@<text> Total Amount : @item.Sum.Format("{0:C}") </text>);
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("ReportListHistoryAjax", "Finance", new { iReportType = 2 }))
.Pageable(x => x.PageSize(20))
.Sortable(x => x.OrderBy(sortOrder => sortOrder.Add(o => o.ClientName).Descending())).Filterable()
.ClientEvents(e => e.OnDataBinding("onRowDataBound")).Selectable()
.Groupable(grouping => grouping.Groups(groups => { groups.Add(x => x.ClientName); }).Visible(false))
)
I also tried this " .GroupFooterTemplate(@<text> Total : 100 </text>); " but not able to display the group footer in grid.
Please some one tell what is the issue, why I am not able to display the aggregate sum and group footer .
Thanks & Regards,
Rajesh W