I can repeat this unhandled exception consistently in our application on both v9.2 and the very latest service release of v10.3. I was able to find a few other posts with people having the same or similar issue and the response was "the grid is out of sync due to a threading issue" without any further followup.
To better determine where we might be modifying the grid off the UI thread or what else might be the cause, could someone explain what MoveFixedRowsToProperLocation is doing and why the sparsearray would become out of sync with the other collection (sparsearray contains 1 item but the grid believes there are 2 rows)?
Thanks!
Infragistics2.Shared.v9.2.dll!Infragistics.Shared.SparseArray.Insert(int index, object item) + 0x103 bytes Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.Move(Infragistics.Win.UltraWinGrid.UltraGridRow row, int newIndex, bool forceDirtyPrimaryMetrics) Line 2849 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.MoveFixedRowsToProperLocation() Line 2865 + 0x75 bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.FixedRowsCollection.VerifyFixedRows(bool verifyScrollCount) Line 231 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.FixedRowsCollection.VerifyFixedRows() Line 180 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.FixedRowsCollection.Count.get() Line 295 C# Infragistics2.Shared.v9.2.dll!Infragistics.Shared.DisposableObjectEnumeratorBase.MoveNext() + 0x2b bytes Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.AddFixedRows(System.Collections.Generic.List<Infragistics.Win.UltraWinGrid.UltraGridRow> list, bool top) Line 126 + 0x60 bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.CalcSpecialAndFixedRowsHelper(out System.Collections.Generic.List<Infragistics.Win.UltraWinGrid.UltraGridRow> outSpecialRows, out System.Collections.Generic.List<Infragistics.Win.UltraWinGrid.UltraGridRow> outFixedRows, bool top, Infragistics.Win.UltraWinGrid.UltraGridRow[] rowsToRecycle) Line 454 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.EnsureSpecialAndFixedRowsCacheCalculated() Line 1176 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetSpecialRows(bool top) Line 2112 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetSpecialRowAtIndex(int index, bool top) Line 2080 + 0xc bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetSpecialRowAtVisibleIndex(int index, bool top) Line 2096 + 0x10 bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetRowAtVisibleIndex(int visibleIndex, bool includeSpecialRows) Line 1862 + 0xd bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetFirstVisibleRow(bool includeSpecialRows) Line 1544 + 0xf bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetFirstVisibleRow() Line 1534 + 0xd bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.FirstRow.get() Line 2321 + 0x28 bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.GetMaxScrollPosition(bool scrollToFill) Line 611 + 0xb bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.EnsureScrollRegionFilled(bool calledFromRegenerateVisibleRows) Line 470 + 0xd bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(bool resetScrollInfo) Line 1516 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows() Line 1503 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(Infragistics.Win.UltraWinGrid.ScrollbarVisibility assumeColScrollbarsVisible) Line 2211 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegionsCollection.AreScrollbarsVisible(Infragistics.Win.UltraWinGrid.ScrollbarVisibility assumeColScrollbarsVisible) Line 93 + 0x14 bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.ColScrollRegion.ResetScrollInfo() Line 1187 + 0x42 bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.ColScrollRegion.RegenerateVisibleHeaders() Line 1147 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetricsHelper() Line 291 + 0x20 bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetrics() Line 271 + 0x8 bytes C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.UltraGridLayout.ApplyLoadedBands() Line 746 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.UltraGridBase.VerifyDataSourceAttached() Line 2856 C# Infragistics2.Win.UltraWinGrid.v9.2.dll!Infragistics.Win.UltraWinGrid.UltraGridBase.OnCreateControl() Line 1785 C# System.Windows.Forms.dll!System.Windows.Forms.Control.CreateControl(bool fIgnoreVisible) + 0x181 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.CreateControl(bool fIgnoreVisible) + 0x12a bytes System.Windows.Forms.dll!System.Windows.Forms.Control.CreateControl() + 0x24 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.WmShowWindow(ref System.Windows.Forms.Message m) + 0x98 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x2b6 bytes System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) + 0x2a bytes System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.WndProc(ref System.Windows.Forms.Message m) + 0x10 bytes System.Windows.Forms.dll!System.Windows.Forms.Form.WmShowWindow(ref System.Windows.Forms.Message m) + 0x41 bytes System.Windows.Forms.dll!System.Windows.Forms.Form.WndProc(ref System.Windows.Forms.Message m) + 0x154 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0x10 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x31 bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) + 0x5a bytes
Hi,
I made a post today with the Header - Grouping Headers and connectors in UltrawinGrid . Can Any one help me out please ??
Hmm, very interesting. Thanks for the info. I will have to keep this in mind as a possible cause for future issues like this.
Thanks for the reply, Mike.
Turned out not to be a threading issue. Long story short, the form was recreating its handle after Dispose was called on it due to a handle check comparing this.Handle against null (bad news).
Using multiple threads with DataBinding is extremely tricky and dangerous. There are any number of things that may happen to the data source or on the DotNet BindingManager or the grid that are out of your control and which will try to cross threads without marshaling.
Neither the grid, nor the BindingManager in DotNet are thread safe. So I would strongly advise against using threading and data binding together unless you are absolutely certain that your second thread will never do anything that might affect the UI Thread.
If you are having a problem which is caused by a threading issue and you are trying to debug it, I wish you luck, but in my experience, you are wasting your time. Debugging an issue caused by a threading problem is nearly impossible, because the exception often occurs long after the real problem happened.
There is a long, detailed discussion of this here:
Work with a dataset bound to a grid on a separate thread - Infragistics Community
I beleive the MoveFixedRowsToProperLocation method is just re-positioning the fixed rows to their proper place within the visible area of the grid.