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

[Solved] Aggregates & Server Binding

0 Answers 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
MelF
Top achievements
Rank 1
MelF asked on 24 Apr 2012, 02:47 AM
I've got my grid working perfectly, until I try to use aggregates to display information in the footer. It's just not showing any values and I'm a not sure where to go from here. Does it have any thing to do with the server binding? Any help appreciated. Here is the grid:

@(Html.Telerik().Grid<GetSalesTotalsForAllRegions_Result>()
               .Name("Grid")
               .BindTo((IEnumerable) ViewBag.SalesTotalsForAllRegions)
               .Columns(columns => { columns.Bound(d => d.regionName).Title("Market<br>Area"); })
               .Columns(columns =>
                            {
                                columns.Bound(d => d.traffic).Title("New<br>Visitors").Aggregate(aggregates => aggregates.Sum())
                                    .FooterTemplate(@<div>@item.Sum</div>);
                            })
               .Columns(columns =>
                            {
                                columns.Bound(d => d.returnTraffic).Title("Return<br>Visitors").Aggregate(aggregates => aggregates.Sum())
                                    .FooterTemplate(@<div>@item.Sum</div>);
                            })
               .Columns(columns => { columns.Bound(d => d.gross).Title("Gross<br>Sales"); })
               .Columns(columns => { columns.Bound(d => d.cancelTotal).Title("Cancels"); })
               .Columns(columns => { columns.Bound(d => d.net).Title("Net<br>Sales"); })
               .Columns(columns => { columns.Bound(d => d.goalLow).Title("Target<br>Plan"); })
               .Columns(columns => { columns.Bound(d => d.variationLow).Title("Var.<br />Target"); })
               .Columns(columns => { columns.Bound(d => d.goalHigh).Title("A &amp; B<br />Plan"); })
               .Columns(columns => { columns.Bound(d => d.variationHigh).Title("Var.<br />A &amp; B"); })
               .Columns(columns => { columns.Bound(d => d.ConversionRateNew).Title("Conv.<br />New").Format("{0:0.0} %"); })
               .Columns(columns => { columns.Bound(d => d.CancellationRate).Title("Canc.<br />Rate").Format("{0:0.0} %"); })
               .DataBinding(dataBinding => dataBinding.Server().Select<DashboardController>(ctr => ctr.Index(null)))
               .EnableCustomBinding(true)
               .Sortable()
      )
Tags
Grid
Asked by
MelF
Top achievements
Rank 1
Share this question
or