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

Formula update

hi

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

this.gridControl1.Model = GridModel.LoadBinary(path);

load file data(cells value) are,
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.

3 Replies

AD Administrator Syncfusion Team 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


LK Lee Kyungjong 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.


AD Administrator Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon