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.

Formula update

Replies:

55038 Jan 23,2007 09:29 AM UTC Jan 24,2007 01:49 PM UTC WinForms 3
 Subscribe to this post Tags: GridControl
Lee Kyungjong
Asked On January 23, 2007 09:29 AM UTC

hi

this.gridControl1.Model.TableStyle.CellType = "FormulaCell";
GridFormulaEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine;
engine.FormulaCopyFlags |= GridFormulaCopyFlags.ClipBoardFormula;
engine.FormulaCopyFlags |= GridFormulaCopyFlags.NamedRangeReferencesUpdated;
engine.FormulaCopyFlags |= GridFormulaCopyFlags.UpdateReferencesDuringDnD;

A B C D E ........
1 5 8 =C1+B1 =C1*2 =B1*3 ........
2 6 9 =SUM(A1:A6) =B1*3
3 5 4
4 2
5 4
6 3

first time,
this.gridControl1.Rows.InsertRange(1, 1);

And then,
A B C D E ........
1
2 5 8 =C1+B1 =C1*2 =B1*3 ........
3 6 9 =SUM(A1:A6) =B1*3
4 5 4
5 2
6 4
7 3

formula cells value not updated.

But second time,
this.gridControl1.Rows.RemoveRange(1, 1);

Then,
A B C D E ........
1 5 8 =B1+A1 =B1*2 =A1*3 ........
2 6 9 =SUM(A1:A5) =A1*3
3 5 4
4 2
5 4
6 3

formula cells value updated.

In excel, if you insert a column or row, then the sum range will be updated. But if you insert a column or row the first time, then not updated. But second time updated.

Is there a way to tell it to refresh?

Thanks.

Replied On January 23, 2007 08:47 PM UTC

Hi Kj922,

Please note that a defect was found in the updating formula references code in Essential Studio Version 3.3.
http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=1092
But this is corrected in the 4.1.0.9 release.

Regards,
Haneef

Lee Kyungjong
Replied On January 24, 2007 02:25 AM UTC

Thank you for the quick response.

But I'm using v4.4.0.51

The problem is first inserting a column or row not updated, but second time updated.

Any suggestions?

Thanks.

Replied On January 24, 2007 01:49 PM UTC

Just a couple of quick things to try.

1) Make sure your LoadBinary call is done before you set all those flags.

2) After calling the Insert to insert the column, try calling grid.Refresh(); to see if that makes a difference.

CONFIRMATION

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.