<script type="text/javascript"> function calculateFreight(summaryCol, summaryData) { totalFreight = ej.sum(summaryData, "Freight");//summaryData parameter - returns the corresponding dataSource totalEmployeeID = ej.sum(summaryData, "EmployeeID"); return totalEmployeeID / totalFreight; } |
@(Html.EJ().Grid<object>("Grid") . . . . .SummaryRow(row => { row.ShowTotalSummary(true) .SummaryColumns(col1 => { col1.SummaryType(SummaryType.Sum) .DisplayColumn("Freight") .DataMember("Freight") .Prefix("Freight-Sum: ") .Format("{0:C2}") .Add(); }) .SummaryColumns(col2 => { col2.SummaryType(SummaryType.Maximum) .DisplayColumn("EmployeeID") .DataMember("EmployeeID") .Prefix("EmployeeID-Max: ") .Format("{0:N0}") .Add(); }) .SummaryColumns(col3 => { col3.SummaryType(SummaryType.Minimum) .DisplayColumn("CustomerID") .DataMember("Freight") .Prefix("Freight-Min: ") .Format("{0:C2}") .Add(); }).Add(); }) . . . . . ) |
<style> #Grid .e-summaryrow{ text-align:left !important; } |