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

Formula Range Refresh in GridDatabound Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

26330 Mar 21,2005 02:53 PM UTC Mar 22,2005 12:46 PM UTC WinForms 6
loading
Tags: GridControl
Vinay
Asked On March 21, 2005 02:53 PM UTC

Hi, I have a formula column in a GridDataBoundGrid. If a cell has a formula =sum(c1:c4) and a row is inserted at index 2 by adding a datarow to the datasource. How can i refresh this formula =sum(c1:c5) Regards Vinay

Administrator [Syncfusion]
Replied On March 21, 2005 06:18 PM UTC

If you are cacheing the GridFormulaTags in grid.model.SaveCellInfo, then try setting these properties: this.engine = ((GridFormulaCellModel)gridControl1.Model.CellModels["FormulaCell"]).Engine; engine.FormulaCopyFlags |= GridFormulaCopyFlags.InsDelRangeReferencesUpdated; engine.FormulaCopyFlags |= GridFormulaCopyFlags.ClipBoardReferencesAdjusted;

Vinay
Replied On March 21, 2005 10:53 PM UTC

Hi The formula range does not refresh even after setting the copyformulaflags. The formula gets computed (i,e the new computed value is shown on the grid) but the range in the formula does not change Sum(c1:c4) continues to stay at sum(c1:c4) when it should have changed to sum(c1:c5) Regards Vinay

Administrator [Syncfusion]
Replied On March 22, 2005 12:56 AM UTC

In order for the grid to update the references for inserted/deleted rows, the grid has to be a GridControl (non-virtual). The reason is the grid has to have direct access to the data. The data has to be stored in the grid.Data object for this to happen. In a GridDataBoundGrid where you manage the data, the grid cannot make these changes for you. So, you will have to make these adjustments. If you change to a GridControl that holds the data, then the grid can do this for you.

Vinay
Replied On March 22, 2005 12:05 PM UTC

Hi, Can i use a virtual grid to solve this problem (moreover i am using an arraylist as the datasource). In case i use the virtual grid do i have cache the formula tags. Regards Vinay

Administrator [Syncfusion]
Replied On March 22, 2005 12:15 PM UTC

If you use a true virtual grid, then you will have to maintain the FormulaTags. Exactly what is your purpose in trying to use an arraylist? Could you not just populate the gridControl directly in the same manner as you are populating the ArrayList?

Vinay
Replied On March 22, 2005 12:46 PM UTC

Hi, I have created a control inheriting ur grid control which accepts an arraylist as the datasource. I have to store the formula entered in the formula cell in one of the object properties stored in the arraylist and the computed value in another property. Only the Formula prperty has been binded to the grid. Using reflection i am setting the computed value in the savecellinfo event. Is there anyway i could rebuild the arraylist reading the data in the grid if i use the virtual grid technique(i.e including the formula and the computed value). Regards Vinay >If you use a true virtual grid, then you will have to maintain the FormulaTags. > >Exactly what is your purpose in trying to use an arraylist? Could you not just populate the gridControl directly in the same manner as you are populating the ArrayList?

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

;