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

Adding Calculation Column

Thread ID:





124252 May 26,2016 07:42 PM UTC May 30,2016 04:14 AM UTC WinForms 3
Tags: PivotGridControl
Chris Bishop
Asked On May 26, 2016 07:42 PM UTC

How to I add a calculation column to a pivot grid.

Col1 - Col2

Adhikesevan Kothandaraman [Syncfusion]
Replied On May 27, 2016 01:17 PM UTC

Hi Chris, 

To add PivotCalculations with the subtraction of two columns, you can use the Formula and CalculationType properties of the PivotComputationInfo. You can set the formula for compute the value of the particular column using the Formula property. Please refer to the following Code snippet,  

Code Snippet: 
// Adding PivotCalculations to the Control 
this.pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo { FieldName = "Amount", Format = "#,##0", SummaryType = SummaryType.DoubleTotalSum }); 
this.pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo { FieldName = "Quantity", Format = "#,##0" }); 
this.pivotGridControl1.PivotCalculations.Add(new PivotComputationInfo { FieldName = "Sub", Format = "#,##0", CalculationType = CalculationType.Formula, Formula = "[Amount] - [Quantity]" }); 
Sample Link: 



Chris Bishop
Replied On May 27, 2016 02:04 PM UTC

Thank you so much!

That worked.

Adhikesevan Kothandaraman [Syncfusion]
Replied On May 30, 2016 04:14 AM UTC

Hi Chris, 

Thanks for your update. 

We are glad to know that your query has been solved. Please let us know if you need any further assistance. 



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