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

Slow Formula Engine

I experience that the formula engine is rather slow at times. This is very noticable when a grid in a multi-sheet family is show for the first time. I have 7 sheets. All are smaller than 10 x 20 cells and have cross-sheet formulas. What is the recommended way to gain maximum speed here?

3 Replies

AD Administrator Syncfusion Team May 25, 2004 04:24 PM UTC

The default behavior is for the grid to parse and compute formulas the first the value is assessed for any reason. So, if you have a cell that is not originally visible, and depends upon several other cells that are not originally visible, the first time the cell is shown, the grid will have to parse and compute all these values. One thing you can try to is go ahead and force the grid to parse and compute all (or maybe a few) cells when the grid is initially loading. This puts all the delay at one place and time which may or may not be good. To do this you would call engine.RecalculateRange with the second argument true. GridFormulaEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine; engine.RecalculateRange(GridRangeInfo.Table(), true); But this only accesses the first sheet registered. We will add a overload that will allow you to call this method on different sheets. You can do the same thing though, by trying to access grid[row, col].FormattedText for every cell(row, col) you want to force a calculation on. Accessing the style.FormattedText will trigger a calculation. string s = grid[row, col].FormattedText Once the calculations have been done, then the only time the values are recomputed would be if one of its dependent cells was changed. So normally, after the first calculations, things are fairly responsive.


AD Administrator Syncfusion Team May 26, 2004 05:18 AM UTC

Thanks. These hint will give me a method to improve response after initial grid construction.


AD Administrator Syncfusion Team May 26, 2004 05:59 AM UTC

One other thing to check. Set the debugger to break on exception to see if there are any exceptions being thrown during this load process. These can slow things down tremendously as there is normally a 1 or 2 second delay with each exception.

Loader.
Live Chat Icon For mobile
Up arrow icon