AD
Administrator
Syncfusion Team
September 20, 2005 11:55 AM UTC
Hi Kevin,
Please refer this Forum thread and see if this helps.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=26396
Let us know if you need further assistance.
Best Regards,
Jeba.
AD
Administrator
Syncfusion Team
September 20, 2005 01:50 PM UTC
i already have this
engine.DoCircularCheckInValidating = true;
althought no idea what it does... but it doesnt seem to stop the exception
AD
Administrator
Syncfusion Team
September 20, 2005 01:57 PM UTC
Hi Kevin,
Can you please send a small sample showing the problem. We will try debugging it here.
Best Regards,
Jeba.
AD
Administrator
Syncfusion Team
September 21, 2005 08:33 AM UTC
here you go
set cell a1 to =1
set cell b1 to =a1
set cell a1 to =b1
BOOM
Exception_5329.zip
AD
Administrator
Syncfusion Team
September 21, 2005 01:18 PM UTC
Hi Kevin,
I updated the sample.If you set engine.DoCircularCheckInValidating propertyto true, a check for circular references will be done in the renderer.OnValidating override of the formula cell type. This will cause the entry to be rejected after an error message is displayed.
//Old Code
private void gridControl1_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
//Old Condition
if (e.RowIndex==1)
if (e.ColIndex!=0)
{
e.Style.CellType="FormulaCell";
e.Style.FormulaTag = fTag[e.ColIndex-1];
e.Style.CellValue = fCell[e.ColIndex-1];
e.Handled=true;
}
}
private void gridControl1_SaveCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridSaveCellInfoEventArgs e)
{
//old condition
if (e.RowIndex==1)
if(e.ColIndex!=0)
{
fTag[e.ColIndex-1] = e.Style.FormulaTag;
fCell[e.ColIndex-1] = (string)e .Style.CellValue;
e.Handled=true;
}
}
//New Code
private void gridControl1_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
//New condition
if (e.RowIndex==1 && e.ColIndex>0)
{
e.Style.CellType="FormulaCell";
e.Style.FormulaTag = fTag[e.ColIndex-1];
e.Style.CellValue = fCell[e.ColIndex-1];
e.Handled=true;
}
}
private void gridControl1_SaveCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridSaveCellInfoEventArgs e)
{
//New Condition
if (e.RowIndex==1 && e.ColIndex>0)
{ fTag[e.ColIndex-1] = e.Style.FormulaTag;
fCell[e.ColIndex-1] = (string)e .Style.CellValue;
e.Handled=true;
}
}
Please refer the updated sample.
exception_5329.zip
Let us know if this helps.
Best Regards,
Jeba.
AD
Administrator
Syncfusion Team
September 22, 2005 10:10 AM UTC
but that line was already in the code in the form load .... !!!
what fixed it in your version of the code was your removal of
int i = Syncfusion.Windows.Forms.Grid.GridFormulaEngine.CreateSheetFamilyID();
Syncfusion.Windows.Forms.Grid.GridFormulaEngine.RegisterGridAsSheet("Grid",this.gridControl1.Model,i);
put these two lines back and your circ ref checking goes out the window !
AD
Administrator
Syncfusion Team
September 22, 2005 10:34 AM UTC
Hi Kevin,
Please provide your Syncfsuion Version details.
Thank you for your patience.
Regards,
Jeba.
AD
Administrator
Syncfusion Team
September 22, 2005 11:21 AM UTC
3.301.0.0
AD
Administrator
Syncfusion Team
September 22, 2005 01:06 PM UTC
Hi Kevin,
Circular reference protection does not work in multiple sheet(s).
Please refer this link:
CicularDefect
Regards,
Jeba.
AD
Administrator
Syncfusion Team
September 22, 2005 01:20 PM UTC
that is terrible... doesnt say a lot for your QA. Can you think of any work around this is pretty fundemental to my project
AD
Administrator
Syncfusion Team
September 24, 2005 10:00 AM UTC
We have corrected this problem in our code base. If you would like to get a private build with the correction in it, you can submit a direct trac support incident and request one, and we will try to accomodate you.
As far as a work-around, if when you enter your formulas, you inculde the sheet references, then I think the current code will catch the circular references.
ie. enter =grid!a1 instead of =a1, and =grid!b1 instead of =b1.
You would need to do this only if you are using multiple sheets. If you are not using multiple sheets, there is not need to call RegisterGridAsSheet which is triggerring the requirement to include sheet names.
One other comment about teh sample above. If you are using a GridControl, it is not required that you maintain your own collection of FormulaTags. You would only need to do this if you are trying to use teh GridControl in virtual mode. In general, it is easier to let the GridControl maintain its own formulatags. But if you need a virtual grid with formula support, then you would have to maintain a formulatag collection, and do the additional work to properly maintain such a collection.