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

[Solved] Grid Aggregates not working

0 Answers 20 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rajesh
Top achievements
Rank 1
Rajesh asked on 28 Aug 2012, 11:19 AM
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
Tags
General Discussions
Asked by
Rajesh
Top achievements
Rank 1
Share this question
or