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
close icon

Problem with forcing formulas to recalculate

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

3 Replies

YG Yavanaarasi G Syncfusion Team April 22, 2008 12:36 PM UTC

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




OM Omar April 23, 2008 02:06 PM UTC

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.



JJ Jisha Joy Syncfusion Team May 1, 2008 12:35 PM UTC

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



Loader.
Live Chat Icon For mobile
Up arrow icon