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

Excel like formula behaviour when inserting columns

Say you have cells B1, B2, and B3. You have a formula cell in A4 set to “=sum(B1:B3)”. In excel, if you insert a column between A and B, then the sum range in A4 will be updated to C1:C3. When you do this in the grid (with InsDelRangeReferencesUpdated and ClipBoardReferencesAdjusted set on the formula engine copy flags), the cell still references B1:B3 and it still displays the old sum until you type a number into B1:B3. How could I replicate the excel behaviour using the grid?

11 Replies

AD Administrator Syncfusion Team November 18, 2005 10:40 PM UTC

Those flags you mentioned should make this work OK in a GridControl that holds its data. Here is a sample that shows this working. http://www.syncfusion.com/Support/user/uploads/GC_Formulas_614341ea.zip What are you doing differently?


AD Administrator Syncfusion Team November 21, 2005 03:55 PM UTC

Hi Clay, In the sample you gave me, the formula cell and its target range are all in the same column: A 5 4 3 =Sum(A1:A3) What I''m doing different is that the target range and the formula cell are in adjacent columns: A B 5 4 3 =Sum(B1:B3) When a column is inserted between A and B, you get the behavior described in my first post. Thanks


AD Administrator Syncfusion Team November 21, 2005 03:59 PM UTC

Sorry, the forum engine ate the tabs in my post. Here''s the corrected section: What I''m doing different is that the target range and the formula cell are in adjacent columns: A B 5 4 3 =Sum(B1:B3)


AD Administrator Syncfusion Team November 21, 2005 04:09 PM UTC

Try not setting this flag: ClipBoardReferencesAdjusted Only set the InsDelRangeReferencesUpdated flag. If this works, and you want to try to also handle the ClipBoardReferencesAdjusted, then you can dynamically set it in grid.ClipboardPaste and then reset it in grid.Model.ClipboardPasted.


AD Administrator Syncfusion Team November 21, 2005 04:24 PM UTC

Unsetting the ClipBoardReferencesAdjusted doesnt'' seem to make a difference. I''ve attached a modified version of your sample that demonstrates my issue. Thanks.

GC_Formulas_614341ea_updated.zip


AD Administrator Syncfusion Team November 21, 2005 05:08 PM UTC

Thank you for the sample. We will have to fix this in our code base. A tentative fix has been made in our code base, and it (or some other fix) should be in the next release build. I do not know a date for this coming release.


AD Administrator Syncfusion Team November 21, 2005 07:44 PM UTC

So the problem is that after the column is inserted, the formula cell''s range should change to C1:C3. I just want to make we agree on what the issue is. Thanks.


AD Administrator Syncfusion Team November 21, 2005 07:50 PM UTC

That is correct. The formula should become =sum(c1:c3) instead of =sum(b1:b3).


AD Administrator Syncfusion Team November 21, 2005 08:17 PM UTC

Excellent. Thank you.


AD Administrator Syncfusion Team November 23, 2005 04:04 PM UTC

Would it be possible to get an issue number for this problem?


AD Administrator Syncfusion Team November 23, 2005 04:35 PM UTC

Here it is. http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=1092

Loader.
Live Chat Icon For mobile
Up arrow icon