Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Sum[Column A] in Column B Formula ?
posted

Hi,

I Have a table with 2 columns A, B

A contains Amounts. B must contain the percentage of those amount (100*B/Sum[A]). This is my snippet:

 

 

 

 

 

 

 

 

DataTable dt = new DataTable();

dt.Columns.Add(

"Amount", typeof(Double));

dt.Columns.Add(

"PercentageAmount", typeof(Double));

dt.Rows.Add(2);

dt.Rows.Add(8);

ultraGrid1.DataSource = dt;

ultraGrid1.DisplayLayout.Bands[0].Columns[

"PercentageAmount"].Formula = "100*[Amount]/Sum([Amount])";

ultraGrid1.CalcManager =

new UltraCalcManager();

I expect to get the following result:

Amount PercentageAmount (%)

2                 20

8                80

I am getting

2              100

8             100

The Sum is operating locally (Row context) Is there a way to handle this?

Thanks for any help

Parents Reply Children