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

How to Save Formulas

Hi I am using gridControl to act as Ms-Excel.I have define GridFormulaCellModel for the grid.The Formulas are working fine.But When i save and close the document and reopen the same document,the formulas defined are not working properly.Its showing the formula correctly but its not giving the results.So How to get activate the formulas after closing the document. I am using SaveBinary and LoadBinary Methods to save and load the Grid data. Please help. Regards, Jitendra.

8 Replies

AD Administrator Syncfusion Team May 12, 2005 10:04 AM UTC

After doing LoadBinary to read teh grid back in, try calling engine.RecalculateRange, passing in GridRangeInfo.table() and also setting the other parameters to force the recalculations.


JI Jitendra May 12, 2005 11:55 AM UTC

Hi Clay, Thanks for the support.Its working fine now.I have another issue to discuss.In this application I have Insert Menu like in Excel.I have done "Insering Rows" by gridControl.Model.Rows.InsertRange() and "Inserting Columns" by gridControl.Model.Cols.InsertRange() methods. But how to implement "Insert Cells" functionality.Is it possible to do that? Regards, Jitendra.


AD Administrator Syncfusion Team May 13, 2005 11:07 AM UTC

You could try to do this. For example, if you want to shift the cells down, you would have to copy the cells in the current column from the row you are on to the botton of the grid. You can use the this.gridControl1.CutPaste.CopyCellsToClipboard method to do this. Then you would blank out the current cell, move the currentcell down one cell, and use this.gridControl1.CutPaste.Paste to paste the copied range 1 cell lower.


JI Jitendra May 13, 2005 11:46 AM UTC

Hi Caly, this.gridControl1.CutPaste.CopyCellsToClipboard method expects GridRangeInfoList as arguement.How to give that GridRangeInfoList.In my case the range is from current column data from current row. shall i give like: this.gridControl1.Selections.GetSelectedCols(true, true); Please help Regards, Jitendra.


JI Jitendra May 13, 2005 11:59 AM UTC

I am not able to get the cells in the current column from the current row to the bottom of the grid.How to get that range? Thanks, Jitendra


AD Administrator Syncfusion Team May 13, 2005 12:45 PM UTC

Try this code: int currentRowIndex = grid.CurrentCell.RowIndex; int currentColIndex = grid.Currentcell.ColIndex; int bottomRowIndex = grid.RowCount; GridRangeInfo range = GridRangeInfo.Cells(currentRowIndex, currentColIndex, bottomRowIndex, currentColIndex);


AD Administrator Syncfusion Team May 13, 2005 12:47 PM UTC

Then create a GridRangeInfoList using: GridRangeInfoList list = new GridrangeInforList(); list.Add(range);


JI Jitendra May 13, 2005 01:16 PM UTC

This Works fine. Thanks Clay.

Loader.
Live Chat Icon For mobile
Up arrow icon