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. Image for the cookie policy date
close icon

Total Row for individual columns

Hi

I have looked through the ASP.net MVC samples and was wondering whether it is possible to have totals at the bottom of multiple columns.

I have a grid which shows timesheet data which includes columns for the Project Code and Activity as well as columns for Monday to Sunday.

I want to enter to total row at the bottom of the Grid which dynamically totals the hours in each column of the day columns.

Does Syncfusion support this and if so, any example available ;-)

Regards

Ross

1 Reply

MS Mohanraj S Syncfusion Team September 18, 2012 06:02 AM UTC

Hi Ross,

 

Thanks for using Syncfusion products.                 

 

Your requirement "Sum of individual columns" can be achieved through using GridSummaryRowDescriptorCollection.

 

Please refer the following code snippet:

private GridSummaryRowDescriptorCollection SummaryCollection

{

            get

            {

                        GridSummaryRowDescriptorCollection summaryRowsCollection = new GridSummaryRowDescriptorCollection();              

                        GridSummaryColumnDescriptor SumDuration = new GridSummaryColumnDescriptor("Duration", SummaryType.Int32Aggregate, "Duration", "{Sum:####}");

                        GridSummaryRowDescriptor sumRow =new GridSummaryRowDescriptor("tot");

                        sumRow.Title = "Total Duration";

                        SumDuration.Prefix = "Tot : ";

                        sumRow.SummaryColumns.Add(SumDuration);

                        summaryRowsCollection.Add(sumRow);

                        return summaryRowsCollection;

            }

}

 

Please refer to the below link to download the sample application.

 

SampleSummaryColumn.zip

 

Please let me know if you have any concerns.

 

Regards,

Mohanraj


Loader.
Live Chat Icon For mobile
Up arrow icon