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.

Custom formulas not updating

Thread ID:

Created:

Updated:

Platform:

Replies:

20417 Oct 17,2004 10:57 PM Oct 18,2004 03:18 PM Windows Forms 1
loading
Tags: GridControl
Denis
Asked On October 17, 2004 10:57 PM

Hi, I have the requirement to have some formula cells directly reference other formula cells which contain some string value (which is the product of a custom function that I use). For example I need the value that is stored in cell A3 "XYZ" to be displayed in B4 and C5. I would like to be able to put the Excel functionality equivalent in B4 and C5 which would be =A3. This obviously doesn’t work in the current grid, so I have added a custom function which retrieves the referenced cell''s FormattedText. B4 and C5 do not update when A3 is changed however (unlike all of the native formulas which automatically update themselves). Is there a way to give my custom formula this same behaviour? Will you be adding string support to the formula engine? eg. ="The cost is: " & B4 & " thousand dollars" Please see the example for more info... example_5114.zip

Administrator [Syncfusion]
Replied On October 18, 2004 03:18 PM

If you call the GetValueFromArgs method, it will allow the grid to properly track the dependent cells.
Public Function Evaluate_Str(ByVal args As String) As String
        Dim c As Integer
        Dim r As Integer
        Try
            ReturnGridRefFromString(args, c, r)
            Dim cellModel As GridFormulaCellModel
            cellModel = Me.grd.CellModels("FormulaCell")
            cellModel.Engine.GetValueFromArg(args)
            Return grd(r, c).FormattedText
        Catch ex As System.Exception
            Return "!! ERROR !!"
        End Try
    End Function

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.

;