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.

Problem with forcing formulas to recalculate

Thread ID:

Created:

Updated:

Platform:

Replies:

73059 Apr 17,2008 04:08 PM May 1,2008 08:35 AM Windows Forms 3
loading
Tags: GridControl
Omar
Asked On April 17, 2008 04:08 PM

Hi,

I have CellA which contains a formula referencing CellB, while CellB contains another formula. If within my code I try to force all the formulae to recalculate using GridFormulaEngine.RecalculateRange, I still can not get the result for CellA. How would I get the result for CellA in code? I've attached a sample which illustrates this problem when you try to edit cellA3 or cellA4.

The temporary workaround I have is to specifically force a recalculate on CellA only (instead of all the cells), but I would like to just get every cell to recalculate.

Thanks.



Syncfusion.zip

Yavanaarasi G [Syncfusion]
Replied On April 22, 2008 08:36 AM

Hi Omar,

Sorry for the delay in responding.

I am able to see the issue that you mentioned here. But the issue has been solved by instead of using the FormulaTag , you can use the FormattedText to get the calculated value.

Please refer the below code snippet:


[VB]
Dim result1, result2 As String
Try
result1 = GridControl1.Model(1, 1).FormattedText
If result1 = "" Then result1 = "NULL"
Catch ex As NullReferenceException
result1 = "NULL"
End Try


Here is the modified sample:

http://websamples.syncfusion.com/samples/Grid.Windows/Syncfusion/main.htm


Please try this and let me know if this helps.

Regards,
G.Yavana



Omar
Replied On April 23, 2008 10:06 AM

Thanks for your reply.

Actually, I'm aware of formattedtext but that won't work for me because I have various cell formatting which I didn't show in the sample, and I need the underlying value not the formatted value.

While inefficient, I guess I will just use the workaround I specified above forcing individual cells to calculate.

Is this a bug?

Thanks for your help.


Jisha Joy [Syncfusion]
Replied On May 1, 2008 08:35 AM

Hi Omar,

This not a bug. We can get the recalculated values through FormattedText property.

Let me know if you have any questions.

Regards,
Jisha



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.

;