On my grid, some of the cells are formula cells. I populate these cells with code similar to:
Dim gsi as GridStyleInfo = New GridStyleInfo()
gsi.CellType = "FormulaCell"
gsi.Format = "#,##0"
gsi.CellValueType = GetType(Double)
gsi.CellValue = newValue '' newValue contains the new formula we want
GridControl1.SetCellInfo(row, col, gsi, Syncfusion.Styles.StyleModifyType.Changes)
For the grid''s initial population, this works fine; the formula''s are interpreted and the proper result displays in the grid.
After some user-interaction, I want to change the formula for some cells. So, I populate the applicable cells with the new formula using the same code.
However, now the cells display the result of the *old* formula, not the new formula. (Although if I obtain the cell''s contents programmatically, it does seem to contain the new formula, it''s just displaying the *old* result).
One other tid-bit: I notice that this only happens when the applicable cells are disabled. If I enable the cells, the new formula is re-calculated correctly. Of course, I don''t want these cells receiving focus, so that''s not a very good option.
What can I do to force the formula cell to recalculate using the *new* formula?
ADAdministrator Syncfusion Team August 9, 2004 12:20 PM
In a cell whose CellType is "FormulaCell", you cannot set the CellValueType to Double. The reason is the cell has to be a string to hold a formula. So, try removing that line and see if things work better.