This is a migrated thread and some comments may be shown as answers.

How we can have the colum summation during running

3 Answers 165 Views
GridView
This is a migrated thread and some comments may be shown as answers.
mehdi
Top achievements
Rank 1
mehdi asked on 03 Jul 2011, 01:29 PM
Hi every body;
Dear all;


We would like to have the summation of each column row by row without using summary row item (the summary row item is used when we have grouping).
It is appreciated if you can answer that, how we can improve the calculation speed whilst the data source is very large (i.e. grater than 200,000 row).

the scheme of our propose is illustrated in following:

Column A     Column B               Calculated Column
   A                     10                       10
   B                      3                        13
   C                      9                        22
   D                      5                        27


 
Yours Sincerely.

3 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 06 Jul 2011, 01:36 PM
Hello Mehdi,

As Ivan answered in your support ticket, RadGridView does not support the "Running sum" function. I will copy his answer in the forum:

"You will need to recalculate the column values every time some of the other values change. If you are using the grid for displaying purposes, you will have to watch for changes in the data source. If the user can edit/add/remove rows/values, you will have to watch for all these cases and recalculate the values in the column."

If more clients request this feature, we will implement it in a future release.

Best regards,
Alexander
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Eric
Top achievements
Rank 1
answered on 23 Jul 2012, 08:28 PM
We would like to see a "running total" feature implemented.  We are not concerned with the underlying data changing, but the grid being sorted by the user.  Is there some work around?
0
Svett
Telerik team
answered on 26 Jul 2012, 03:03 PM
Hi Eric,

You can do that by setting the ShowTotals property of GridViewMasterTemplate in cooperation with defining summary items. You can use the following code snippets to achieve the desired scenario:
GridViewSummaryItem summaryItem = new GridViewSummaryItem("Amount", "Amount: {0}", GridAggregateFunction.Sum);
GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem();
summaryRowItem.Add(summaryItem);
 
this.radGridView1.SummaryRowsBottom.Add(summaryRowItem);
this.radGridView1.DataSource = this.GetSource();

You can read more about summaries in RadGridView by reading the online documentation.

Kind regards,
Svett
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
mehdi
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Eric
Top achievements
Rank 1
Svett
Telerik team
Share this question
or