Hi,
I added a formula to a bound column and set the datasource at run time. but i get this error message "Object reference not set to an instance of an object.". if i remove the formula, everything runs smoothly.
and also i added an unbound column with a formula to the column and i get the same error message.
Does anybody know why?
Thanks,
KM
Where/When does the error occur? Can you post the call stack? Did you try setting the IDE to break on all run-time exceptions so you can see what object is null?
It happens when I try to set datasource.
here is the call stack:
at Infragistics.Win.UltraWinGrid.RefCellCollection.RefCellCollectionEnumerator.MoveNext() at Infragistics.Win.CalcEngine.UltraCalcEngine.RecalcReferences(IUltraCalcReference reference) 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.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(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[ commandLine) at Mobex.My.MyApplication.Main(String[ Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[ args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[ args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
Kamal
Hi Kamal,
Well, that's pretty clearly raising the exception in the CalcManager code, so I don't think this is likely to be anything you are doing. I recomend gettin the latest hot fix if you don't already have it. If that doesn't help, you should Submit an incident to Infragistics Developer Support
Mike,
I too am receiving the error that KM reported back in 2008 when adding unbound columns to a grid and setting the data source. I'm using version 13.1.20131.2079.
Here is my call stack:
System.NullReferenceException occurredHResult=-2147467261Message=Object reference not set to an instance of an object.Source=Infragistics4.Win.UltraWinGrid.v13.1StackTrace:at Infragistics.Win.UltraWinGrid.RefCellCollection.RefCellCollectionEnumerator.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.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.ReCalc()at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalcSynchronous()at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.VerifyReCalc()at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.DirtyCalc(IUltraCalcReference reference, ValueDirtiedAction action)at Infragistics.Win.UltraWinCalcManager.UltraCalcManager.Infragistics.Win.CalcEngine.IUltraCalcManager.AddReference(IUltraCalcReference reference)at Infragistics.Win.UltraWinGrid.UltraGridBase.RegisterWithCalcManager()at Infragistics.Win.UltraWinGrid.UltraGridLayout.ResumeCalcManagerNotifications()at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated(BindingManagerBase bindingManager)at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated()at Infragistics.Win.UltraWinGrid.UltraGridBase.Set_ListManager(Object newDataSource, String newDataMember)at Infragistics.Win.UltraWinGrid.UltraGridBase.SetDataBindingHelper(Object dataSource, String dataMember, Boolean hideNewColumns, Boolean hideNewBands)at Infragistics.Win.UltraWinGrid.UltraGridBase.SetDataBinding(Object dataSource, String dataMember, Boolean hideNewColumns, Boolean hideNewBands)at Infragistics.Win.UltraWinGrid.UltraGridBase.SetDataBinding(Object dataSource, String dataMember, Boolean hideNewColumns)at Infragistics.Win.UltraWinGrid.UltraGridBase.SetDataBinding(Object dataSource, String dataMember)
Any update on this issue would be appreciated.
Mike
Unfortunately, there are too many other factors involved here for the stack trace to tell me what's going on. I suspect this is either a threading issue (is your application using multiple threads) or else it's caused by a particular combination of property setting on the grid.
The first thing I recommend if that you try setting FormulaRowIndexSource (on the Override) to RowIndex and see if that helps. A lot of these kinds of issues are caused by a sort've catch-22 that occurs that occurs when formulas are trying to use the VisibleIndex (which is the default) and the formulas are dependent on filtering.
If that does not help, can you duplicate the exception in a small sample project so we can check it out?