We are getting an error that is hard to duplicate and occurs at different points. The common occurrences seem to be when our grid is filtered and the user double clicks on a record to do some editing. When they come back from the editing dialog and we try to refresh the grid, this error occurs and the message "Object reference not set to an instance of an object" pops up.
When we run it in debug mode, it does not error out on any specific line of code, so we are having problems figuring out where the error is happening and on what code. From the detail below, its is happening on some type of calculations, but we have no idea how to figure out what its doing at the time or on what calculation. Any ideas? We are using Infragistics 8.3 still
thanks!
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinGrid.RefUtils.GetRowCalcIndex(UltraGridRow row, FormulaRowIndexSource rowIndexType) at Infragistics.Win.UltraWinGrid.RefRowIterator.GetNextRow() at Infragistics.Win.UltraWinGrid.RefRowIterator.MoveNext() at Infragistics.Win.UltraWinGrid.RefRowIterator.MoveNext() at Infragistics.Win.UltraWinGrid.RefRowIterator.MoveNext() 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.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.RowsCollectionVisibilityChanged(IUltraCalcReference reference) at Infragistics.Win.UltraWinGrid.ViewStyleBase.OnAfterRowListCreated_ProcessBand(UltraGridBand band) at Infragistics.Win.UltraWinGrid.ViewStyleBase.OnAfterRowListCreated(RowScrollRegion rsr) at Infragistics.Win.UltraWinGrid.ViewStyleBase.RecreateRowList(RowScrollRegion rsr) at Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(Boolean resetScrollInfo) at Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(ScrollbarVisibility assumeColScrollbarsVisible) at Infragistics.Win.UltraWinGrid.RowScrollRegion.PositionScrollbar(Boolean resetScrollInfo) at Infragistics.Win.UltraWinGrid.ScrollRegionBase.SetOriginAndExtent(Int32 origin, Int32 extent) at Infragistics.Win.UltraWinGrid.RowScrollRegion.SetOriginAndExtent(Int32 origin, Int32 extent) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.ResizeRowScrollRegions() at Infragistics.Win.UltraWinGrid.DataAreaUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.set_Rect(Rectangle value) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(Message& m) 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)
You should be able to download the source code by logging into My Keys and Downloads on the Infragistics website and then clicking on NetAdvantage for .NET 2008 vol. 2. You will then be able to scroll down and see the option for Source Code. Try that and let me know if you need further assistance.
Michael S.
Hi,
emarkunger said:I could probably simply step through the code to identify why the exception occurs.
Maybe, but I wouldn't be too sure. The calculation network is all asynchronous, so it's pretty tough to debug even for those of us who know the source code well.
If you have a subscription that includes the source code, then you should be able to download it from our web site, but I personally have no idea where it is. I will send a message to someone in Developer Support and ask them if they can point you to it.
I'll try, it may take me a few days. If I had the .pdbs and source for 8.2.20082.2204 or at least just the Infragistics2.Win.UltraWinCalcManager.v8.2.dll I could probably simply step through the code to identify why the exception occurs. That would be faster than creating a whole new solution to reproduce it. I know the source is supposed to be available but haven't been able to find it online.
Can you post a small sample project that I can use to duplicate any of these exceptions? There are too many variables here for me to duplicate this without a sample.
Another exception here. This call frame seems much simpler and I can tell the steps that created it. Same grid as before. Five bands and I have to correct some information from previous posts. The summaries are for Band 0 and Band 2 (not Band 1). The Band 2 summary formula is:
"sum( [BrokerEquity] ) - [../../BrokerEquity]"
which is simply the sum of the BrokerEquity column of the Band 2 row collection minus the BrokerEquity column of the parent row.
Now to generate the exception, this is what I did. First the binding list was created and the grid displayed. Then the entire binding list was cleared using .ClearItems() then it was repopulated simply by adding a bunch of the business objects for band 0 that already had child objects in each business object for the other bands. Then another business object for band 0 was added but its binding list property used for band 1 was empty. Then a business object was added to child binding list of that business object. It's easier to understand the last two sentences with the code shown:
entity =
new LegalEntity(margin.LegalEntity);
_entities.Add(entity); // _entities is the binding list for band 0 bound to binding source DataSource
custodian = new Custodian(margin.CustodianName);
entity.Brokers.Add(custodian); // Brokers is the binding list for band 1 - previously empty
// at this point the Custodian.Accounts is empty which is used for band 2
so the formula of "sum (band2 column) - band 1 column" should simply return 0 or empty value for the sum part but it is generating an NullReferenceException because the RowsCollection is null as shown in the stack trace below:
Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RefUtils.GetRow(Infragistics.Win.UltraWinGrid.RowsCollection rows = null, int calcIndex = 0, Infragistics.Win.UltraWinGrid.FormulaRowIndexSource rowIndexType = VisibleIndex) + 0x64 bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RefRowIterator.GetFirstRow() + 0x1ff bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RefRowIterator.MoveNext() + 0x352 bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RefRowIterator.MoveNext() + 0x74 bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RefRowIterator.MoveNext() + 0x74 bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RefSummaryValueCollection.RefSummaryValueCollectionEnumerator.MoveNext() + 0x24 bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.CalcEngine.RangeCalcInfo.EvaluateNextRow() + 0x4a bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.CalcEngine.UltraCalcEngine.Evaluate(long ticks = -1) + 0xbe bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.CalcEngine.UltraCalcEngine.Recalc(long ticks = -1) + 0xdc bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalcInternal(long ticks = -1) + 0xe4 bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalc(long millis = -1) + 0x1a6 bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalc() + 0x29 bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.UltraWinCalcManager.UltraCalcManager.ReCalcSynchronous() + 0x48 bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.UltraWinCalcManager.UltraCalcManager.VerifyReCalc() + 0x5c bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.UltraWinCalcManager.UltraCalcManager.DirtyCalc(Infragistics.Win.CalcEngine.IUltraCalcReference reference = {Infragistics.Win.UltraWinGrid.RowReference}, Infragistics.Win.UltraWinCalcManager.ValueDirtiedAction action = RowReferenceAdded) + 0x6c bytes Infragistics2.Win.UltraWinCalcManager.v8.2.dll!Infragistics.Win.UltraWinCalcManager.UltraCalcManager.Infragistics.Win.CalcEngine.IUltraCalcManager.AddRowReference(Infragistics.Win.CalcEngine.IUltraCalcReference reference = {Infragistics.Win.UltraWinGrid.RowReference}) + 0x75 bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.NotifyCalcManager_RowAdded(Infragistics.Win.UltraWinGrid.UltraGridRow row = {Infragistics.Win.UltraWinGrid.UltraGridRow}) + 0x143 bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.SyncRows_Add(Infragistics.Win.UltraWinGrid.UltraGridRow row = {Infragistics.Win.UltraWinGrid.UltraGridRow}, int desiredIndex = -1) + 0x17f bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.SyncRows_Add(Infragistics.Win.UltraWinGrid.UltraGridRow row = {Infragistics.Win.UltraWinGrid.UltraGridRow}) + 0x27 bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.OnListChangedHelper(System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}, bool calledFromBandListChanged = false) + 0xb22 bytes Infragistics2.Win.UltraWinGrid.v8.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.OnListChanged(object sender = Count = Implicit function evaluation is turned off by user., System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x2f bytes [Native to Managed Transition] [Managed to Native Transition] System.dll!System.ComponentModel.BindingList<System.__Canon>.OnListChanged(System.ComponentModel.ListChangedEventArgs e) Line 168 C# System.dll!System.ComponentModel.BindingList<System.__Canon>.FireListChanged(System.ComponentModel.ListChangedType type, int index) Line 202 C# System.dll!System.ComponentModel.BindingList<System.__Canon>.InsertItem(int index, System.__Canon item) Line 233 C#