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
close icon

Do not recalculate the formula in GridControl

Hello!
Do not recalculate formulav table. Suppose there are 6 columns and rows.
6 = column formula, which puts the value of 2 and 4.
The default values in the cells are. But when I change a figure, say a cell line 2, the 6 cell and is the sum of the default value

1 Reply

MG Mohanraj Gunasekaran Syncfusion Team February 23, 2017 02:21 PM UTC

Hi Slava, 

Thanks for using Syncfusion products. 
 
We have tried to reproduce your scenario using below attached sample. But we are unable to reproduce your scenario at our end. By default, if you have used the cell reference in formula cell for calculations, the changes will be automatically reflected while changing that reference cell value. Please provide your code part to reproduce your scenario. If we have missed anything in our sample, please modify the sample to reproduce your scenario. It will be helpful to provide the solution at the earliest. 
 
Sample link: GridControl 
Video link: VideoDemo 

Note: 
If you want to force a range of cells to recalculate or refresh the formula cell, you can use the ReCalculateRange or RefreshRange method in CurrentCellEditingComplete event. Please refer to the below code example, 
Code example 
GridFormulaCellModel model = (GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]; 
GridFormulaEngine engine = model.Engine; 
 
this.gridControl1.CurrentCellEditingComplete += gridControl1_CurrentCellEditingComplete; 

void gridControl1_CurrentCellEditingComplete(object sender, EventArgs e) 
{ 
    GridCurrentCell currentCell = this.gridControl1.CurrentCell; 
    GridRangeInfo range = GridRangeInfo.Row(currentCell.RowIndex); 
    engine.RecalculateRange(range, true); 
    //You can use below method instead of RecalculateRange method 
    model.RefreshRange(range); 
 
} 

Regards, 
Mohanraj G. 


Loader.
Live Chat Icon For mobile
Up arrow icon