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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Resetting the formula engine

Thread ID:

Created:

Updated:

Platform:

Replies:

60093 Apr 27,2007 06:57 AM UTC Apr 27,2007 04:22 PM UTC WinForms 1
loading
Tags: GridControl
Ben Fraser
Asked On April 27, 2007 06:57 AM UTC

I am using Grid Version 4.4.0.51, .NET 2.0

I am using a virtually bound GridControl with all the cells of type FormulaCell. It's the formulas that are the problem.

I would like to be able to replace my backing data store for the grid to a set of entirely different data at run time, numerous times over. This is to provide a 'drill-down' effect on a cell the user clicks on to get more information.

To put that another way, the user will click on a cell (or whatever), my program will make the backing data store point at a different array of data and then queryCellInfo and friends will point to the new data array. At a later time the user clicks something else and the original data set is restored and the cell info functions all know about that change.

This much works fine for just getting values to display in the grid. However, the model.Engine.DependentCells hashtable still contains a whole bunch of dependencies between the formulas in the old data store after the new data store has come into use. This causes all sorts of problems.

I've tried calling Clear on the hashtable and doing a complete refresh of the grid with no luck. Other attempts have failed also.

Is there a way to tell the engine to forget all of the formula dependencies, or do I have to create a new grid in this situation?

Cheers,
Ben

Administrator [Syncfusion]
Replied On April 27, 2007 04:22 PM UTC

There is a second collection in the grid that you need to clear. But in addition, you also need to clear your cache of GridFormulaTag objects. If you are using formulacells in a GridDataBoundGrid, then you need to be caching the FormulaTags in Model.SaveCellInfo and providing them back in Model.QueryCellInfo. Exactly, how you clear your formulatag cache would depend upon what you are using to hold them. In addition, as part of clearing your formulatag cache, you would also want to clear whatever formulas are in your grid.DataSource. If you do not, they will just reappear.


engine.DependentCells.Clear();
engine.DependentFormulaCells.Clear();
ClearFormulaTagCacheAndFormulasFromDataSource();
grid.Refresh();

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.

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

;