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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

formula refresh

Thread ID:





18927 Sep 13,2004 07:48 PM UTC Sep 14,2004 03:09 PM UTC General Discussion 2
Tags: General Discussion
Asked On September 13, 2004 07:48 PM UTC

I am using the grid control and have a formula in one cell that is acting as a Total column. I set up the cell in the following manner: Me.YearlyDataGrid(1, 1).CellType = "FormulaCell" Dim YearRange As GridRangeInfo Dim LastColumnAlpha As String LastColumnAlpha = YearRange.GetAlphaLabel(yearCount + 1) Me.YearlyDataGrid(1, 1).CellValue = "=SUM(B1:" & LastColumnAlpha & "1)" I just want this cell to show a total of all the cells to to the right but that number could potentially change every time I open the form. It seems to work for the most part except that when I open my form I call the above code then set the values for the cells to the right of this total. This is done by the following code: Dim cnt As Integer For cnt = 0 To yearCount - 1 If yearlyData(cnt) <> 0 Then Me.YearlyDataGrid(1, cnt + 2).CellValue = CStr(yearlyData(cnt)) End If Next However, the total cell will just display 0 until the user types in a value into one of the cells on the grid. The user my not want to type in values though. It should just display a total of cells as set with this second code snippet. I have tried refreshing the row and that didn''t seem to work. Any suggestions on how to get it recalc. Thanks, Jennifer

Administrator [Syncfusion]
Replied On September 14, 2004 01:43 PM UTC

In your formload (or after setting the initial values where ever you do it), try calling engine.RecalculateRange to force the calculations to be done initially. ''recalculate cell 1,1 Dim engine As GridFormulaEngine = CType(grid.CellModels("FormulaCell"), GridFormulaCellModel).Engine engine.RecalculateRange(GridRangeInfo.Cell(1,1), True)

Replied On September 14, 2004 03:09 PM UTC

Thanks for your suggestion. Unfortuanately I was not able to use RecalculateRange. It was not a member of the GridFormulaEngine object. (Maybe because of my version) But your suggestion did get me far enough that I found Refresh(string) and was able to use that successfully. Thanks again. -Jennifer


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon