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.
Unfortunately, activation email could not send to your email. Please try again.

Excel like formula behaviour when inserting columns

Thread ID:

Created:

Updated:

Platform:

Replies:

37300 Nov 18,2005 01:54 PM Nov 23,2005 11:35 AM Windows Forms 11
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 18, 2005 01:54 PM

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?

Administrator [Syncfusion]
Replied On November 18, 2005 05:40 PM

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?

Administrator [Syncfusion]
Replied On November 21, 2005 10:55 AM

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

Administrator [Syncfusion]
Replied On November 21, 2005 10:59 AM

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)

Administrator [Syncfusion]
Replied On November 21, 2005 11:09 AM

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.

Administrator [Syncfusion]
Replied On November 21, 2005 11:24 AM

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

Administrator [Syncfusion]
Replied On November 21, 2005 12:08 PM

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.

Administrator [Syncfusion]
Replied On November 21, 2005 02:44 PM

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.

Administrator [Syncfusion]
Replied On November 21, 2005 02:50 PM

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

Administrator [Syncfusion]
Replied On November 21, 2005 03:17 PM

Excellent. Thank you.

Administrator [Syncfusion]
Replied On November 23, 2005 11:04 AM

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

Administrator [Syncfusion]
Replied On November 23, 2005 11:35 AM

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

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.

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.

;