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

Stack OverFlow exception when Adding Columns to GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

107111 Feb 13,2013 04:04 PM UTC Feb 26,2013 11:51 AM UTC WinForms 5
loading
Tags: GridControl
Joey C
Asked On February 13, 2013 04:04 PM UTC

I receive a "System.StackOverflowException" when trying to add a column to the gridControl
Error Message: {Cannot evaluate expression because the current thread is in a stack overflow state.}
 
When code for the "formula.fomulaCopyFlags" is set to "GridFormulaCopyFlags.InsDelRangeReferencesUpdated" then I receive a stackoverflow exception.
I have attached a small demo program that will produce the error. Without this line of code, inserting columns throws no exceptions.
 
Clicking the column header and clicking the button the first time does not produce the error but once the add column button is clicked a second time it throws and exception. I would like to update the cell formula references when a column or row is inserted or removed. So this particular feature is needed.
 
I am using the v10.4.0.71 trial version for windows forms on a 64-bit windows 7 machine with .NET 4.0 framework.
 
Thanks for your help.
 
Joey


WindowsFormsApplication1_975cb27.zip

Vinish Kumar K [Syncfusion]
Replied On February 14, 2013 11:41 AM UTC

Hi Joey Coleman,

 

 

Thank you for your interested in Syncfusion products.,

 

We have analyzed your query ‘stack overflow exception in GridControl when formula cell are used’. We can able to reproduce the issue in our end. Currently we are working on this query to resolve this issue. We will get back you with the solution on  February 18, 2013.

 

Appreciate your patience.

 

Regards,

Vinish.Hi Joey Coleman,

 

 

Thank you for your interested in Syncfusion products.,

 

We have analyzed your query ‘stack overflow exception in GridControl when formula cell are used’. We can able to reproduce the issue in our end. Currently we are working on this query to resolve this issue. We will get back you with the solution on  February 18, 2013.

 

Appreciate your patience.

 

Regards,

Vinish.


Joey C
Replied On February 20, 2013 01:17 PM UTC

Hi Vinish,
 
I am just wondering if you have found any resolve to my issue?
 
Joey

Vinish Kumar K [Syncfusion]
Replied On February 25, 2013 05:36 AM UTC

Hi Joey

 

We deeply regret for the inconvenience caused with delay.

 

Query

Stack overflow exception while inserting column

We have analyzed your sample with oue Grid.Windows source. We can able to reproduce the issue in our end and the root cause of this issue is the reference of the inserted columns is doesn’t refreshed. To avoid this issue you can use the following code in your application. Please refer the below codes.

 

formulaEngine.FormulaCopyFlags = GridFormulaCopyFlags.InsDelRangeReferencesUpdated;

            formulaEngine.FormulaCopyFlags = GridFormulaCopyFlags.ClipBoardReferencesAdjusted;

 

We hope this will help to you to avoid the exception. Please refer the attached sample file also.

 

Please let me know if you have further concerns.

 

Warm Regards,

Vinish.



Stack overfolw exception resolved_5d28e865.zip

Joey C
Replied On February 25, 2013 01:47 PM UTC

Thank you. That fixed that issue. Now I have run into another issue with the formulas. Even when the formulacopyflags= GridFormaCopyFlags.InsDelRangeReferencesUpdated the formula references are not updated. I have attached the same .zip that you previously attached. Enter a formula and then add a column. Notice that the formula does not update for its new location reference.
 
Joey

 



Stack overfolw exception resolved_d912fb89.zip

Vinish Kumar K [Syncfusion]
Replied On February 26, 2013 11:51 AM UTC

Hi Joey,

Thanks for your update.

Query

Formulas doesn’t referenced

We have analyzed your query with the sample. I am afraid that I could not able to identify the exact issue with the sample. You have mentioned in your last update the formula cells are doesn’t referenced.

 

The reason for the issue may be the formula engine binded to the grid is not refreshed after this occurrence. Hence the recalculation in formula engine has to be performed. Please refer to the following code.

 

 

engine.RecalculateRange(GridRangeInfo.Table())

 

You could achieve the desired behavior by setting the FormulaCopyFlags to the GridFormulaEngine. See the code:

 

//setup copying formulas

 

engine = ((GridFormulaCellModel)this.gridCalculations.CellModels["FormulaCell"]).Engine;

engine.FormulaCopyFlags |= GridFormulaCopyFlags.ClipBoardFormula;

engine.FormulaCopyFlags |= GridFormulaCopyFlags.ClipBoardReferencesAdjusted;

engine.FormulaCopyFlags |= GridFormulaCopyFlags.InsDelRangeReferencesUpdated;

 

 

Please use the above suggestions in your apps. And let me know if it helps to you. If you have any concerns, please provide any sample with proper replication procedure. It will help us to provide proper response quickly.

 

 

Warm Regards,

Vinish Kumar K


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

;