Hello,
I have a grid whose datasource is an IBindingList and that is added to a Usercontrol. When showing the control that holds the grid I've gotten the following stack trace intermittently. Note this error does not appear during initialization of the grid, just subsequent attempts to show it among other controls. Any ideas of what might be going on?
************** Exception Text **************System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at Infragistics.Shared.DisposableObjectCollectionBase.GetItem(Int32 index) at Infragistics.Win.UltraWinGrid.VisibleRowsCollection.get_Item(Int32 index) at Infragistics.Win.UltraWinGrid.ViewStyleBase.OffsetRows(VisibleRowFetchRowContext& context, Int32 index, Int32 count, Int32 amountToOffset) at Infragistics.Win.UltraWinGrid.ViewStyleBase.CreateRowsList_FixedRowsFeature(VisibleRowFetchRowContext& context, VisibleRow parentVisibleRow, UltraGridRow firstSibling) 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.ViewStyleBase.FitColumnsToWidth() at Infragistics.Win.UltraWinGrid.BandsCollection.CalculateBandMetrics(Int32 pass) at Infragistics.Win.UltraWinGrid.BandsCollection.CalculateBandMetrics() at Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetricsHelper() at Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetrics() at Infragistics.Win.UltraWinGrid.UltraGridLayout.ApplyLoadedBands() at Infragistics.Win.UltraWinGrid.UltraGridBase.VerifyDataSourceAttached() at Infragistics.Win.UltraWinGrid.UltraGridBase.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.SetVisibleCore(Boolean value) at System.Windows.Forms.Form.SetVisibleCore(Boolean value) at System.Windows.Forms.Control.Show()
Thanks,
sbeaudry
Is your application using threading at all? This kind of error commonly occurs if your applicaiton is using multiple threads without properly marshalling across to the UI Thread.
Yes threading is involved. There are multiple threads used during my application's runtime. The grid is representing the contents of a multi-user database and these mismatches might be happening because another user is changing the data the grid is presenting. Can you provide a high level description of how threads and marshalling are best handled when using the grid?