We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Summary format

Thread ID:





121721 Jan 19,2016 03:19 PM UTC Jan 20,2016 06:12 AM UTC ASP.NET MVC 1
Tags: Grid
Mika Kahilainen
Asked On January 19, 2016 03:19 PM UTC


Question is related to this sample: https://www.syncfusion.com/kb/4107/how-to-bind-timespan-value-to-grid-column

If Summary is added for  Worked Hours column, how it can be formatted to keep time format? It will show sum as decimal but I need to convert in into time like 12:23:00.


Ragavee U S [Syncfusion]
Replied On January 20, 2016 06:12 AM UTC

Hi Mika,

Since WorkedHours column is a complex object using summary will provide incorrect result and so we can use custom summary option to show correct values. Please refer the below code example.


         . . . .

                .SummaryRow(row => {

                    row.SummaryColumns(col => {




<script type="text/javascript">

          function TimeSpanCounter(summary, data) {

            data = ej.select(data, ["WorkedHours"]);

            //Helper to calulate the total time

            var getter = function (prop, divisor, prev) {

                var f = ej.select(data, [prop]), sum = 0 + (prev || 0);

                sum += ej.sum(f);

                if (prop == "Hours")

                    return sum;

                return {

                    prev: ~~(sum / divisor),

                    org: sum % divisor



            var sec = getter("Seconds", 60), min = getter("Minutes", 60, sec.prev), hours = getter("Hours");

            return this.formatting(summary.format, hours) + " : " + this.formatting(summary.format, min.org) + " : " + this.formatting(summary.format, sec.org);



The formatting of the result is done with the formatting method of the Grid. The custom summary method will be provided with two arguments i.e., summary details and the current view data of the grid.

For your convenience, we have created a sample with the above solution, which can be downloaded from the below location.

Sample Link: http://www.syncfusion.com/downloads/support/forum/121721/ze/Sample1193677306

Ragavee U S.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon