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
Mike,
Now i found that problem isn't only associated with formula summary. I am able to reproduce it if there is group level 3 to 4 where each group has normal summary(like sum,avg.) column then grid takes time to calculate summary for all group rows.And if meanwhile i change the datasouce it is throwing error.
CalcManager Doesn't have Enabled property. And if i am trying to set grid's calcManager property to null it is throwing an error of infragistics. I'll need to make many change to reproduce this bug otherwise i'll send error discription to you.
is there any way to identify whether grid is busy or not?
Thanks,
Hi Yashpal,
yashpalsharma said:is there any way to identify whether grid is busy or not?
No, there is no way to tell this. But the real issue here is that you should not have to. The CalcManager should not be raising an exception. At the very least, worst-case scenario here is that you should get a calculation result of a reference error, since the grid column or summary that the formula is asking for no longer exists. It should never blow up.
If you can duplicate this in a small sample project, we can check this out and get it fixed.