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

GridFormulaTag - seeking clarification

Thread ID:

Created:

Updated:

Platform:

Replies:

6730 Aug 25,2003 03:09 PM UTC Aug 26,2003 01:51 PM UTC WinForms 5
loading
Tags: GridControl
Paul Laudeman
Asked On August 25, 2003 03:09 PM UTC

I have a cell defined on my unbound grid as a formula cell that sums a number of cells on the grid. The cell's GridStyleInfo object will return a null value for FormulaTag if the cell that does the summing has not been navigated to or otherwise made visible to the user. Once the cell that displays the sum is viewed, then I can access the FormulaTag property. Is there something special I have to do to make the Text property in the FormulaTag always available or is there a better way to handle this?

Administrator [Syncfusion]
Replied On August 25, 2003 03:53 PM UTC

By default, the formulas are only computed as needed. If you want to force formulas to be computed, you can try using the GridFormulaEngine.RecalculateRange method passing in the range of cells you want to calculate: GridFormulaEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine; engine.RecalculateRange(GridRangeInfo.Cell(row, col), true);

Paul Laudeman
Replied On August 25, 2003 08:13 PM UTC

Unfortunately, that is not working for me. I can see that the Text property of the GridStyleInfo object has the SUM value that I'm trying to run, but after I call the RecalculateRange the FormulaTag object is null. Is there a way I can just tell the grid to compute everything by default, rather than on demand? > By default, the formulas are only computed as needed. If you want to force formulas to be computed, you can try using the GridFormulaEngine.RecalculateRange method passing in the range of cells you want to calculate: > > > GridFormulaEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine; > engine.RecalculateRange(GridRangeInfo.Cell(row, col), true); > >

Paul Laudeman
Replied On August 25, 2003 09:28 PM UTC

After upgrading to 1.6.1.5 I noticed in the release notes a new method called "GetValueFromGrid" on the GridFormulaEngine class. This does exactly what I need, but I'm still puzzled why your first suggestion didn't work for me. Thanks anyway! > Unfortunately, that is not working for me. I can see that the Text property of the GridStyleInfo object has the SUM value that I'm trying to run, but after I call the RecalculateRange the FormulaTag object is null. > > Is there a way I can just tell the grid to compute everything by default, rather than on demand? > > > > By default, the formulas are only computed as needed. If you want to force formulas to be computed, you can try using the GridFormulaEngine.RecalculateRange method passing in the range of cells you want to calculate: > > > > > > GridFormulaEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine; > > engine.RecalculateRange(GridRangeInfo.Cell(row, col), true); > > > > >

Administrator [Syncfusion]
Replied On August 25, 2003 09:45 PM UTC

What version of the code are you using? The attached program seems to work OK for me in 1.6.1.5. It gets the computed value of a cell two ways, one through the style's FormattedText which works without the call to RecalculateRange, and the other way is through the FormulaTag.Text property which requires the call. Can you post a sample of what you are trying to do that does not work?

Paul Laudeman
Replied On August 26, 2003 01:51 PM UTC

I missed adding the "true" statement to the RecalculateRange call to force it to recalculate the non-visible cells -- that fixed the problem. Thanks for including the sample to help verify that it was working properly. > What version of the code are you using? The attached program seems to work OK for me in 1.6.1.5. > > It gets the computed value of a cell two ways, one through the style's FormattedText which works without the call to RecalculateRange, and the other way is through the FormulaTag.Text property which requires the call. > > Can you post a sample of what you are trying to do that does not work? >

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

;