Hello,
I've seen a few posts about this on the site, but they were on different versions.
One of our customers (so not wide spread, but common with them) are running into an issue with our application that can take on one of two forms: 1. One of the grids is replaced by a big red x.
2. The application appears frozen.
For issue 1, I have the following call exception/call stack:
Exception object: 0a93b1ccException type: System.NullReferenceExceptionMessage: Object reference not set to an instance of an object.InnerException: <none>StackTrace (generated): SP IP Function 0018B0B0 181A5788 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.UltraGridRow.get_ScrollCountInternal()+0x68 0018B0CC 181A5705 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.UltraGridRow.Infragistics.Shared.ISparseArrayMultiItem.get_ScrollCount()+0x5 0018B0D0 10477198 Infragistics2_Shared_v10_2!Infragistics.Shared.SparseArray.GetItemAtScrollIndex(Int32, Infragistics.Shared.ICreateItemCallback)+0x1f0 0018B104 10476F71 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.ScrollCountManagerSparseArray.GetItemAtScrollIndex(Int32, Boolean)+0x29 0018B118 10476F07 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.RowsCollection.GetRowAtScrollIndex(Int32, Boolean)+0x87 0018B130 10476E67 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.RowsCollection.GetRowAtScrollIndex(Int32)+0x7 0018B134 10476E4C Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.UltraGridLayout.GetRowAtScrollPos(Int32)+0x2c 0018B144 181A5E1D Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.ViewStyleBase.CreateRowsList_FixedRowsFeature(Infragistics.Win.UltraWinGrid.VisibleRowFetchRowContext ByRef, Infragistics.Win.UltraWinGrid.VisibleRow, Infragistics.Win.UltraWinGrid.UltraGridRow)+0xf5 0018B1B0 1047743A Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.ViewStyleBase.RecreateRowList(Infragistics.Win.UltraWinGrid.RowScrollRegion)+0x1c2 0018B264 10475675 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.RowScrollRegion.GetMaxScrollPosition(Boolean, Boolean)+0x1f5 0018B2B0 104743CA Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.RowScrollRegion.EnsureScrollRegionFilled(Boolean)+0x6a 0018B2C0 104741EC Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(Boolean)+0x74 0018B2EC 10473FB2 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(Infragistics.Win.UltraWinGrid.ScrollbarVisibility)+0xb2 0018B304 10473EED Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.ScrollRegionBase.WillScrollbarBeShown()+0xd 0018B30C 1697951B Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.DataAreaUIElement.AddIntersectionHelper(Infragistics.Win.UIElementsCollection, Infragistics.Win.UltraWinGrid.RowScrollRegion, Infragistics.Win.UltraWinGrid.ColScrollRegion, Infragistics.Win.UltraWinGrid.RowScrollRegion, Infragistics.Win.UltraWinGrid.ColScrollRegion, Boolean, Boolean)+0x63b 0018B454 169783EA Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.DataAreaUIElement.PositionChildElements()+0x42a 0018B508 1527C45E Infragistics2_Win_v10_2!Infragistics.Win.UIElement.VerifyChildElements(Infragistics.Win.ControlUIElementBase, Boolean)+0x86 0018B53C 16977FA6 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(Infragistics.Win.ControlUIElementBase, Boolean)+0xde 0018B55C 16977EAA Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.DataAreaUIElement.set_Rect(System.Drawing.Rectangle)+0x3a 0018B580 169772D7 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.UltraGridUIElement.PositionChildElements()+0xb47 0018B620 1527C45E Infragistics2_Win_v10_2!Infragistics.Win.UIElement.VerifyChildElements(Infragistics.Win.ControlUIElementBase, Boolean)+0x86 0018B654 16976685 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(Infragistics.Win.ControlUIElementBase, Boolean)+0x3d 0018B688 16A0F662 Infragistics2_Win_v10_2!Infragistics.Win.UIElement.DrawHelper(System.Drawing.Graphics, System.Drawing.Rectangle, Boolean, Infragistics.Win.AlphaBlendMode, Boolean, Boolean, Boolean)+0x1b2 0018B9AC 16A0F33F Infragistics2_Win_v10_2!Infragistics.Win.ControlUIElementBase.Draw(System.Drawing.Graphics, System.Drawing.Rectangle, Boolean, Infragistics.Win.AlphaBlendMode, System.Drawing.Size, Boolean)+0x177 0018BA54 16A0F1AE Infragistics2_Win_v10_2!Infragistics.Win.ControlUIElementBase.Draw(System.Drawing.Graphics, System.Drawing.Rectangle, Boolean, Infragistics.Win.AlphaBlendMode)+0x4e 0018BA90 1A89275A Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.UltraGridUIElement.Draw(System.Drawing.Graphics, System.Drawing.Rectangle, Boolean, Infragistics.Win.AlphaBlendMode)+0x62 0018BAB8 16A0F13D Infragistics2_Win_v10_2!Infragistics.Win.UltraControlBase.OnPaint(System.Windows.Forms.PaintEventArgs)+0x85 0018BADC 169764F5 Infragistics2_Win_UltraWinGrid_v10_2!Infragistics.Win.UltraWinGrid.UltraGrid.OnPaint(System.Windows.Forms.PaintEventArgs)+0xb5 0018BB20 6BFA732A System_Windows_Forms_ni!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs, Int16, Boolean)+0x9a 0018BB5C 6BFA99A4 System_Windows_Forms_ni!System.Windows.Forms.Control.WmPaint(System.Windows.Forms.Message ByRef)+0x1d4 0018BCA4 6BF989EE System_Windows_Forms_ni!System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)+0x33e 0018BCFC 6BF986A0 System_Windows_Forms_ni!System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)+0x10 0018BD04 6BF98621 System_Windows_Forms_ni!System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)+0x31 0018BD18 6BF984FA System_Windows_Forms_ni!System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)+0x5a
I don't have a call stack for symptom 2 in front of me, but it's very similar. The difference is within get_ScrollCountInternal() there a TryGetValue() call that in turn iterates a dictionary (two actually). When the application hangs I can see that the top stack frame address changes (indicating progress) but even after waiting 5+ minutes this iteration never completes causing control to never returned back from OnPaint.
Is this by chance fixed in an available update? Below is my version information for UltraWinGrid:
0:000> lmvm Infragistics2_Win_UltraWinGrid_v10_2start end module name63580000 637ae000 Infragistics2_Win_UltraWinGrid_v10_2 (deferred) Image path: C:\Windows\assembly\GAC_MSIL\Infragistics2.Win.UltraWinGrid.v10.2\10.2.20102.1004__7dd5c3163f2cd0cb\Infragistics2.Win.UltraWinGrid.v10.2.dll Image name: Infragistics2.Win.UltraWinGrid.v10.2.dll Has CLR image header, track-debug-data flag not set Timestamp: Fri Jun 11 13:34:41 2010 (4C1281C1) CheckSum: 0022CEBD ImageSize: 0022E000 File version: 10.2.20102.1004 Product version: 10.2.20102.1004 File flags: 0 (Mask 3F) File OS: 4 Unknown Win32 File type: 2.0 Dll File date: 00000000.00000000 Translations: 0000.04b0 CompanyName: Infragistics Inc. ProductName: Infragistics2.Win.UltraWinGrid InternalName: Infragistics2.Win.UltraWinGrid.v10.2.dll OriginalFilename: Infragistics2.Win.UltraWinGrid.v10.2.dll ProductVersion: 10.2.20102.1004 FileVersion: 10.2.20102.1004 FileDescription: Infragistics2.Win.UltraWinGrid.v10.2 LegalCopyright: Copyright(c) 2001-2010 Infragistics, Inc. LegalTrademarks: UltraGrid Comments: Infragistics UltraGrid control class library - Release Version
Hi Chad,
There are basically two possibilities here.
1) This is a threading issue. Is your application using multiple threads?
2) This is a bug in the grid. The best solution in this case would be to try to update to the latest service release and see if that helps. There were a number of issues like this in the grid that were fixed. It's also possible that the issue exists in 10.2 and was not fixed until a later release, though. So if the service release does not help, the next step would be to try it with the latest version (13.2).
Thanks for the response.
The applicaiton is definitely multi threaded, which I agree is almost always the cause of red x issues. However, I've (well several of us actually) have been beating down multi threaded issues for years and can't seem to find any more than impact this particular grid.
Hopefully this isn't a stupid question, but where do I obtain the service releases? I'm not typically the one that handles getting updates for Infragistics, and I think the person that used to has left the company.
Sorry... I always include a link to the service releases page when I recommend updating and for some reason, I forgot this time.
How to get the latest service release - Infragistics Community
In my experience, using multiple threads and data binding is always a problem. It's nearly impossible to get it to work correctly, except in the most limited of cases. When using threads, you have to be in control of the communication between the threads. And when it comes to data binding, you are simply not in control. The grid, it's DataSource, and the BindingManager are all communicating behind the scenes and you have no way to stop it or get involved in that process to marshal the data.
Greetings.
I guess since my circumstance has changed a reply might not be best, but it was an easy starting point. I worked out most of the thread synchronization to correct "Big Read X" over the years, down to a very infrequent occurrence I chose to just handle the exception on to prevent the red x.
So fast forward and now I have the first instance of this type issue in over 2 years, except now it's a hang condition and not a crash condition. The top of my stack is similar to before:
OS Thread Id: 0xb0c (0)Child SP IP Call Site0016deb4 713c3e92 System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].FindEntry(System.__Canon)0016ded8 7146ac6e System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].TryGetValue(System.__Canon, System.__Canon ByRef)0016dee8 0a3c00a6 Infragistics.Win.UltraWinGrid.UltraGridRow.get_ScrollCountInternal()0016df00 0a3bff65 Infragistics.Win.UltraWinGrid.UltraGridRow.Infragistics.Shared.ISparseArrayMultiItem.get_ScrollCount()0016df04 09552eda Infragistics.Shared.SparseArray.EnsureScrollCountCalculatedHelper(NodeExtended)0016df20 09552df4 Infragistics.Shared.SparseArray.EnsureScrollCountCalculated()0016df28 09552d8b Infragistics.Shared.SparseArray.GetVisibleCount()
So now instead of get_ScrollCountInternal() throwing an exception, it just ends up never returning a value. That in turn holds OnPaint open foreaver, and bad things from there.
Any thoughts on how to approach this situation? My suspect is that something is going on with row filtering, probably a timing related event, but since all the objects are Infragistics I'm at a loss on how to progress.
Incase this helps, here's how filtering is working for us. When the user selects a filter we first call
UltraGrid.DisplayLayout.Bands[0].ColumnFilters.ClearAllFilters
And then for this instance (Where Grid = UltraGid):
ColumnFilter filter = Grid.DisplayLayout.Bands[0].ColumnFilters[StatusFieldName]; filter.FilterConditions.Add(FilterComparisionOperator.Equals, AnalysisStatus.Failed.ToResourceString());
And this works fine, but at some point later as new items are captured and added to the collection (that may or may not match the filter) we end up in the hang condition. Items will initially be added to the collection as AnalysisStatus.Pending and then move to Failed or Passed. If Failed, then they would appear on screen per the filter criteria and the user would key whatever caused the failure, causing the row to no longer be displayed (assuming no further failures).
The actual backing collection to the grid is locked on add/remove, but that's not happening at the time of this hang condition. An item is pending adding to the collection, but that thread is waiting to invoke until this OnPaint event completes (or whatever else is in the way of invoke).
I'm not sure what other details would be helpful.
An infinite loop inside that method implies that something in the list of rows is changing during the loop - which, of course, can only happen if there's some kind of threading issue.
Is the lockup consistent? Can you reproduce it reliably? Or is it random/arbitrary?
If it's consistent, then it COULD be an issue with the UltraCalcManager - assuming you are even using one in your application. If so, try setting the FormulaRowIndexSource property to either ListIndex or RowIndex. It defaults to RelativeIndex and this can something cause an infinite loop when combined with Filtering.
this.ultraGrid1.DisplayLayout.Override.FormulaRowIndexSource = Infragistics.Win.UltraWinGrid.FormulaRowIndexSource.RowIndex;
If that doesn't help, or if you are not using CalcManager, then I'm afraid I am out of ideas, other than - don't use threading and DataBinding together in the same application.
Well, if it's not CalcManager-related, then really, I have no idea.
If it is a threading issue, then debugging it would be next to impossible, even if we could reliably reproduce it, which it sounds like you cannot do, since it's inconsistent. That's one of the hallmarks of a threading issue, in fact - they are typically inconsistent, hard to reproduce, and they often cause exceptions that occur nowhere near the actual problem code and sometimes a wide range of exceptions seemingly at random.
I suppose you could try upgrading to a new version of the controls. There have been some bug fixes made to the ScrollCountInternal-related code over the years. So if you are still using v10.2 like you were when this thread started,it's not entirely outside the realm of possibility that what you are experiencing is not related to threading, but is just a bug in the control that has been fixed over the years. Of course, even if that's the case, I'm not sure how you would verify it if you can't reliably reproduce the issue.
Definitely not CalcManager. We do not use that, and do not even deploy the DLL with our app.
The situation is very inconsistent. The portions of code we are discussion here have not changed in many years, apart from adding an extra filter option or two. The application has a very large user base (10s of thousands of users shouldn't be an exaggeration at this point) and literally this is the first instance reported of a hang condition like this.
I hear you on the threading + DataBind, that's been a sore spot in this app for years (as this thread shows) but unfortunately it's so deeply rooted in the app at this point that changing the design isn't really an option.
Locking the collection in OnPaint is an option, not one I like but it is an option. This would prevent add/remove, but it would not prevent data values from changing impacting the filtered items, if that matters for what you are thinking.