Hello,
I am getting this exception sometimes when I sort on a formula column calcuated by the CalcManager. It looks like this problem is related to the UltraGridLayout.Load(Stream stream, PropertyCategories propertyCategories) method. It works fine if I don't load any layout to the grid.
Regards,
Jason
All Events Information: 1 : Timestamp: 5/30/2008 2:19:00 AMMessage: Infragistics.Win.CalcEngine.UltraCalcException: Invalid reference //ultraGrid1/Main/(). Empty element encountered at location 18. at Infragistics.Win.CalcEngine.RefParser..ctor(String refName) at Infragistics.Win.CalcEngine.RefBase.CreateParsedReference() at Infragistics.Win.CalcEngine.RefBase.get_ParsedReference() at Infragistics.Win.UltraWinGrid.UltraGridRefBase.get_ParsedReference() at Infragistics.Win.UltraWinGrid.UltraGridRefBase.ContainsReferenceHelper(IUltraCalcReference inReference, Boolean isProperSubset) at Infragistics.Win.UltraWinGrid.UltraGridRefBase.IsSubsetReference(IUltraCalcReference inReference) at Infragistics.Win.CalcEngine.UCRecalcChain.RemoveSubsetReferences(IUltraCalcReference reference) at Infragistics.Win.CalcEngine.UltraCalcEngine.ProcessDeleteFormula(IUltraCalcFormula formula, IUltraCalcReference baseReference) at Infragistics.Win.CalcEngine.UltraCalcEngine.ProcessTopologicalEvent(QueueInfo item) at Infragistics.Win.CalcEngine.UltraCalcEngine.CleanTopologicalEventQueue(Int64 ticks) at Infragistics.Win.CalcEngine.UltraCalcEngine.Recalc(Int64 ticks) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalcInternal(Int64 ticks) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalc(Int64 millis) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.Infragistics.Win.CalcEngine.IUltraCalcManager.PerformAction(UltraCalcAction action, Object data) at Infragistics.Win.UltraWinGrid.SortedColumnsCollection.ProcessNewSortedColumnsHelper(SortedColumnsCollection newSortedColumns, Boolean fireEvents, Boolean groupBy) at Infragistics.Win.UltraWinGrid.SortedColumnsCollection.SetSortedColumn(UltraGridColumn column, SortIndicator sortIndicator, Boolean groupBy, Boolean clearExistingNonGroupByColumns, Boolean fireEvents) at Infragistics.Win.UltraWinGrid.UltraGridBand.SetSortedColumn(UltraGridColumn column, SortIndicator sortIndicator, Boolean clearExisting) at Infragistics.Win.UltraWinGrid.UltraGridColumn.ClickSortIndicator() at Infragistics.Win.UltraWinGrid.HeaderUIElement.EndDragHelper(Boolean cancelled) at Infragistics.Win.UltraWinGrid.HeaderUIElement.OnMouseUp(MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseUpHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseUp(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)Category: GeneralPriority: -1EventId: 1Severity: InformationTitle:Machine: HK2638XPApp Domain: MarketWatch.vshost.exeProcessId: 5080Process Name: C:\Documents and Settings\a456056\a456056_view_portfolio_monitor_1.2_dev\vob_portfolio_monitor\Frontend\bin\Debug\MarketWatch.vshost.exeThread Name: Win32 ThreadId:5180Extended Properties: ----------------------------------------
I've had a couple similar issues, one being exactly as is being described in this post, the other very similar having to do with the timer tick event running even though the grid had been disposed of. I had a ticket open with Infragistics for that one, however, I never got a resolution and eventually gave up, luckily it didn't occur too frequently. However, recently I started getting the issue described in this post and have not been able to fix it utilizing the out of the box assemblies. However, I was able to completely prevent the issue from occurring by modifying the timerTick event using the source code from infragistics. If I make Infragistics.Win.CalcEngine.QueueInfo a public class and then add the following code at the beginning of the timer tick event, the error never gets thrown.
if(this.calcEngine != null && this.calcEngine.EventQueue != null && this.calcEngine.EventQueue.Count > 0)
{
object[] qi = this.calcEngine.EventQueue.ToArray();
for(int i = 0; i < qi.Length; i++)
if ((qi[i] as UltraCalcEngine.QueueInfo).Reference.ElementName == "()")
this.StopTimer();
return;
}
While this does fix my issue for now I am wary about using a modified control as I don't know how looping through this queue will effect performance or other areas. Can someone from Infragistics look at this code sample and advise of a more elegant solution?
Thanks
I received this error with both 9.1 and 9.2 I am using Load from binary file for display layout. Seems to happen when trying to rebind a new dataset in grid if all calculations aren't completed. If I set the calc manager to Sychronous then I never got the error.
Infragistics.Win.CalcEngine.UltraCalcException was unhandled Message="Invalid reference //ugSearch/tblShipment/FK_tblShipmentPieceQuote_tblShipment/(). Empty element encountered at location 60." Source="Infragistics2.Shared.v9.1" StackTrace: at Infragistics.Win.CalcEngine.RefParser..ctor(String refName) at Infragistics.Win.CalcEngine.RefBase.CreateParsedReference() at Infragistics.Win.CalcEngine.RefBase.get_ParsedReference() at Infragistics.Win.UltraWinGrid.UltraGridRefBase.get_ParsedReference() at Infragistics.Win.UltraWinGrid.UltraGridRefBase.ContainsReferenceHelper(IUltraCalcReference inReference, Boolean isProperSubset) at Infragistics.Win.UltraWinGrid.UltraGridRefBase.IsSubsetReference(IUltraCalcReference inReference) at Infragistics.Win.CalcEngine.UltraCalcEngine.FormulasSubsetOf(IUltraCalcReference baseReference, IUltraCalcReferenceCollection referenceCollection) at Infragistics.Win.CalcEngine.UltraCalcEngine.ConnectReferences(IUltraCalcReference reference, Int32 connect) at Infragistics.Win.CalcEngine.UltraCalcEngine.ProcessTopologicalEvent(QueueInfo item) at Infragistics.Win.CalcEngine.UltraCalcEngine.CleanTopologicalEventQueue(Int64 ticks) at Infragistics.Win.CalcEngine.UltraCalcEngine.Recalc(Int64 ticks, Boolean isStartOfRecalcOperation) at Infragistics.Win.CalcEngine.UltraCalcEngine.Recalc(Int64 ticks) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalcInternal(Int64 ticks) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalc(Int64 millis) at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.onTimerTick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
try giving a null value to the grid calc manager before loading the layout, but dont forget to reassign it.
I too was plagued by this issue when I used "grid.DisplayLayout.SaveAsXml(xmlStream, PropertyCategories.SortedColumns);" followed by, grid.DisplayLayout.LoadFromXml(xmlStream);.
Using the overload, "grid.DisplayLayout.LoadFromXml(xmlStream,PropertyCategories.SortedColumns);" seems to prevent the issue for me. I suppose passing the PropertyCategory tells the LoadFromXml method what to expect so the CalcManager doesn't try to apply any formulas or summaries that don't exist in the xml.
I am also getting this error whenever I load a layout file that involves the calcmanager.