1
Reply

get an (extra) row with the totals in Kendo Grid (Kendo UI)

Cassie Mod

Cassie Mod

Jul 7 2016 4:59 AM
221
HI ive got the following grid made with kendo UI.
But how can I get the totals ? like shown in the picture below ?
 
here is my kendo Grid :
 
  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.                             .Template(f => string.Format("<div style=\"text-align: right\">€ {0:n2}</div>", f.NrcPerUnit));  
  26.                         columns  
  27.                             .Template(f => string.Format("<div style=\"text-align: right\">€ {0:n2}</div>", f.NrOfUnits * f.NrcPerUnit))  
  28.                             .Title("Totaal");  
  29.                         columns  
  30.                             .Bound(c => c.MrcPerUnit)  
  31.                             .Template(f => string.Format("<div style=\"text-align: right\">€ {0:n2}</div>", f.MrcPerUnit));  
  32.                         columns  
  33.                             .Template(f => string.Format("<div style=\"text-align: right\">€ {0:n2}</div>", f.NrOfUnits * f.MrcPerUnit))  
  34.                             .Title("Totaal p/m");  
  35.                     })  
  36.                   )  
  37.               </div>  
  38.           </div>  
thnks guys
 

Answers (1)