Cassie Mod

Cassie Mod

  • NA
  • 488
  • 70.2k

Kendo grid not filled correctly

Jul 11 2016 10:59 AM
HI,
 
Ive got the following gridview with totals.
However if I want to fill, the last two columns , its shows the results, but it is removing the totals. What am I doing wrong ?
 
 
here is my input ( gridview above) 
 
here is my code for the kendo gridview to show the other two colums
  1. <div class="row">  
  2.     <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">  
  3.         <h4>Organisatiebreed</h4>  
  4.         @(Html.Kendo().Grid<OrderLine>()  
  5.               .HtmlAttributes(new { @class = "table-responsive" })  
  6.               .Name("OrderLinesGrid")  
  7.               .Selectable(s => s.Enabled(false))  
  8.               .Reorderable(r => r.Columns(false))  
  9.               .Resizable(r => r.Columns(true))  
  10.               .Scrollable(s => s.Height("auto").Enabled(false))  
  11.               .Sortable(s => s.Enabled(false))  
  12.               .Pageable(p => p.Enabled(false))  
  13.               .Filterable(f => f.Enabled(false))  
  14.               .BindTo(Model.OrderLines.Where(x => x.LocationCode == null))  
  15.               .Columns(columns =>  
  16.               {  
  17.                   columns  
  18.                       .Bound(c => c.NrOfUnits);  
  19.                   columns  
  20.                       .Bound(c => c.ProductCode);  
  21.                   columns  
  22.                       .Bound(c => c.Description);  
  23.                   columns  
  24.                       .Bound(c => c.NrcPerUnit)  
  25.                       .Format("{0:C}")  
  26.                       .ClientFooterTemplate("Totaal: #=sum#");  
  27.                   columns  
  28.                       .Bound(c => c.MrcPerUnit)  
  29.                       .Format("{0:C}")  
  30.                       .ClientFooterTemplate("Totaal: #=sum#");  
  31.                   columns  
  32.                       .Template(f => string.Format("<div style=\"text-align: right\">€ {0:n2}</div>", f.NrOfUnits*f.NrcPerUnit))  
  33.                       //.Template(c => {}).ClientTemplate("#=calculateField(data)#")  
  34.                       .Title("Totaal per stuk");  
  35.                       //.ClientFooterTemplate("Totaal: #=sum#");  
  36.                   columns  
  37.                       .Template(f => string.Format("<div style=\"text-align: right\">€ {0:n2}</div>", f.NrOfUnits * f.MrcPerUnit))  
  38.                       .Title("Totaal per stuk per maand");  
  39.               }  
  40.               )  
  41.             // vanaf hier  
  42.             .DataSource(dataSource => dataSource  
  43.                     .Ajax()  
  44.                     .ServerOperation(false)  
  45.                     .Aggregates(aggregates =>  
  46.                     {  
  47.   
  48.                         aggregates.Add(c => c.MrcPerUnit).Sum();  
  49.                         aggregates.Add(c => c.NrcPerUnit).Sum();  
  50.                     })  
  51.                     .Read(read => read.Action("Aggregates_Read""Order").Data("getParameters"))  
  52.                 )  
  53.         // tot hier  
  54.      
 however when I used the uncommenced code .Template(c => {}).ClientTemplate("#=calculateField(data)#")   and //.ClientFooterTemplate("Totaal: #=sum#");   , it is showing the result of the column but it has removed my totals...... ( see picture)
 
 
 Soo.. How can I fix this ??? or tell me what i'm doing wrong.
 
thnx guys .

Answers (1)