Hi,
I am working with formula summary in Ultragrid at runtime , where summary of one column dependent on summary of other columns. I have CalcManager to handle the formula. But Grid taking time to calculate the summary of formula summary column and if meanwhile i change the datasouce. I am getting "Object reference not set to an instance of an object".
I am sending the stacktrace:-
at Infragistics.Win.UltraWinGrid.RefSummaryValueCollection.RefSummaryValueCollectionEnumerator.MoveNext() at Infragistics.Win.CalcEngine.RangeCalcInfo.EvaluateNextRow() at Infragistics.Win.CalcEngine.UltraCalcEngine.Evaluate(Int64 ticks) at Infragistics.Win.CalcEngine.UltraCalcEngine.Recalc(Int64 ticks, Boolean isStartOfRecalcOperation) 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) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at Myproject.Program.Main() in F:\MyProject\Program.cs:line 22
Please reply as soon possible.
Is your application using multiple thread? It looks like you might be doing some multi-threading here which may be cause the data source to get changed which the CalcManager is in the middle of processing a calculation.
If that's not the case, then what version of the controls are you using?
Can you duplicate this issue in a small sample project?
Perhaps you can work around this by disabling the CalcManager before you change the grid's DataSource.
Thanks Mike for your Response.
"Is your application using multiple thread?"
No , I am not using multiple thread.
"It looks like you might be doing some multi-threading here which may be cause the data source to get changed which the CalcManager is in the middle of processing a calculation."
I am binding datasouce at click of the list's item (that i have at form with grid) . As i told you it is taking time to calculate the summary for formula Summary column dependent on other columns summary. But at UI user can change datasouce by clicking on different list item as Summary process is running in backgroud.
"If that's not the case, then what version of the controls are you using?"
NetAdvantage for .NET 2009.1
"Can you duplicate this issue in a small sample project?"
i can try.If there isn't any other way.
"Perhaps you can work around this by disabling the CalcManager before you change the grid's DataSource."
I am not disabling the calcManager.Instead of this i am disabling the list and using CalculationCompleted Event to identify is Calculation get completed.And whenever it get completed i am enabling the list.
What would u think?
can my current solution lead to another errors?
or should i disable the calcManager get the expected working (as optimal way)?
Thanks
Yashpal Sharma