Hello. I'm wondering what the best way is to troubleshoot a problem I'm having with the Syncfusion GridControl version 6.403.0.15.
The application we have is flexible in that it allows users to define formula's for the grid. Some cell values are loaded with data and then other cells are loaded with formula's that do something with that data.
What happens is that when the formula's are loaded into the cells, if there is a circular reference, the GridControl throws a StackOverflowException and crashes the application.
Is there a way to test the formula's or load the grid and validate it in some way so that I might catch the exception before it happens?
Here's a simple example (attached as well).
I have a Windows Form with a 6.403.0.15 Syncfusion GridControl on it. Cell A1 = 1, cell B1 = 2 and cell C1 = A1 + B1. That works. If I set cell A1 = C1, creating the circular reference, you'll see the behavior I'm referring to.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Load += new EventHandler(Form1_Load);
}
void Form1_Load(object sender, EventArgs e)
{
gridControl1.SetCellInfo(1, 1, GetGridStyleInfo("=A3", "FormulaCell", typeof(string)), Syncfusion.Styles.StyleModifyType.Changes);
gridControl1.SetCellInfo(2, 1, GetGridStyleInfo(2, "Static", typeof(Double)), Syncfusion.Styles.StyleModifyType.Changes);
gridControl1.SetCellInfo(3, 1, GetGridStyleInfo("=A1+A2", "FormulaCell", typeof(string)), Syncfusion.Styles.StyleModifyType.Changes);
gridControl1.ConfirmChanges();
}
private GridStyleInfo GetGridStyleInfo(object cellValue, string cellType, Type type)
{
GridStyleInfo gridStyleInfo = new GridStyleInfo();
gridStyleInfo.CellType = cellType;
gridStyleInfo.CellValue = cellValue;
gridStyleInfo.CellValueType = type;
return gridStyleInfo;
}
}
StackOverflowExceptionExample_babaf9.zip