HI,
I have a xamdatagrid that is connected to a real-time data source via an iBindingList. The data source regularly fires updates to indicate a record has been updated, added or removed. ocassionaly I get the exception listed below when the grid attempts to remove a record. It quite hard to send you a sample of the problem as its very specifiic to our environment. Can you please advise if the stack trace below is something that has been observed and fixed. I'm using v10.1 patch 2018
Inner Exception:
Index was outside the bounds of the array.
at Infragistics.Windows.Helpers.SparseArray.ValidateIndex(Int32 index)
at Infragistics.Windows.Helpers.SparseArray.GetItem(Int32 index, ICreateItemCallback createItemCallback)
at Infragistics.Windows.Helpers.SparseArray.get_Item(Int32 index)
at Infragistics.Windows.DataPresenter.UnsortedRecordSparseArray.GetItem(Int32 index, Boolean create, Boolean calledFromSortedManagerSparseArray, Boolean& newRowCreated)
at Infragistics.Windows.DataPresenter.MainRecordSparseArray.CreateItem(SparseArray array, Int32 relativeIndex)
at Infragistics.Windows.Helpers.SparseArray.CreateItemHelper(ICreateItemCallback createItemCallback, Node node, Int32 nodeIndex, Int32 overallIndex)
at Infragistics.Windows.DataPresenter.MainRecordSparseArray.GetItem(Int32 index, Boolean create)
at Infragistics.Windows.DataPresenter.RecordCollectionBase.get_Item(Int32 index)
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.CachedInfo.GetFixedNonSpecialRecords(List`1 list, Boolean top)
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.VerifySpecialRecords()
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.Verify()
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.GetIndexOf(Record record, Boolean verify)
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.System.Collections.IList.IndexOf(Object value)
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.IndexOf(Record record)
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.RemoveRecord(Record record, Boolean notifyListeners)
at Infragistics.Windows.DataPresenter.RecordManager.RemoveAt(Int32 index, Boolean notifyListeners)
at Infragistics.Windows.DataPresenter.RecordManager.RemoveRecordHelper(Int32 index)
at Infragistics.Windows.DataPresenter.RecordManager.OnSourceCollectionAddOrRemove(NotifyCollectionChangedEventArgs e)
at Infragistics.Windows.DataPresenter.RecordManager.OnBindingListChanged(Object sender, ListChangedEventArgs e)
at Infragistics.Windows.DataPresenter.RecordManager.ProcessChangeNotification(Object sender, Object eventArgs)
at Infragistics.Windows.DataPresenter.RecordManager.OnChangeNotification(Object sender, Object eventArgs, Boolean isReset)
at Infragistics.Windows.DataPresenter.RecordManager.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at Infragistics.Windows.Helpers.BindingListChangedEventManager.OnListChanged(Object sender, ListChangedEventArgs e)
at MorganStanley.MSDotNet.MR2.SQData.Linq.Internal.BindableViewBase.OnListChanged(Object sender_, ListChangedEventArgs args_) in m:\dev\msdotnet\mr2\8.3.0\src\assemblies\MR2\SQData\LinQ\Internal\MR2\BindableViewBase.cs:line 477
at MorganStanley.MSDotNet.MR2.SQData.Linq.Internal.BindableViewBase.SendEventToUI(ListChangedEventArgs args_) in m:\dev\msdotnet\mr2\8.3.0\src\assemblies\MR2\SQData\LinQ\Internal\MR2\BindableViewBase.cs:line 452
at MorganStanley.MSDotNet.MR2.SQData.Linq.Internal.TypedBindableView`1.RemoveListRow(Int32 mr2RowIndex_, Int32 listIndex_) in m:\dev\msdotnet\mr2\8.3.0\src\assemblies\MR2\SQData\LinQ\Internal\MR2\TypedBindableView.cs:line 510
at MorganStanley.MSDotNet.MR2.SQData.Linq.Internal.BindableViewBase.HandleRemoveRow(Object sender_, Int32 rowIndex_) in m:\dev\msdotnet\mr2\8.3.0\src\assemblies\MR2\SQData\LinQ\Internal\MR2\BindableViewBase.cs:line 516
at MorganStanley.MSDotNet.MR2.SQData.Linq.Internal.BindableViewBase.HandleUnderlyingVersionChange(Object sender_, IMR2SQDataStructureChange version_) in m:\dev\msdotnet\mr2\8.3.0\src\assemblies\MR2\SQData\LinQ\Internal\MR2\BindableViewBase.cs:line 408
at MorganStanley.MSDotNet.MR2.SQData.MR2SQDataUserModeBoundaryLayer.SyncedHandleVersionChange(Object args_) in m:\dev\msdotnet\mr2\8.3.0\src\assemblies\MR2\SQData\MR2SQDataUserModeBoundaryLayer.cs:line 1213
Hello Danglei,I am not absolutely sure that we are talking for the same issue, or at least we are not able to confirm it with the stack trace. We can confirm that the original issue that was reported previously was fixed.Can you please give me more details about your scenario, also I will appreciate if you send me sample application where I will be able to reproduce this issue and confirm when is fixed. Thank you. Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Hi,
We've been seeing similar issues with almost exactly the same stack trace. So we've upgraded to the latest service release which went out late last month however it did not really help much.
One interesting thing to note is that before the update (10.2.2001) we were seeing the exception on ItemRemoved events (the index was perfectly ok, like #200 among a list of 2000 items), and now after the update (10.2.2045) we're seeing the exception now randomly thrown on ItemUpdated events (again index was ok too).
Usecase is very similar and the stacktrace is almost identical. These can be found below and I've masked some of the lines to hide some private code. Should you need them I can provide them to you email/private message, for which I believe there's a NDA between Infragistics and us.
Thanks for your help in advance!
System.IndexOutOfRangeException was unhandled
Message=Index was outside the bounds of the array.
Source=InfragisticsWPF3.v10.2
StackTrace:
at Infragistics.Collections.SparseArray.ValidateIndex(Int32 index)
at Infragistics.Collections.SparseArray.GetItem(Int32 index, ICreateItemCallback createItemCallback)
at Infragistics.Collections.SparseArray.get_Item(Int32 index)
at Infragistics.Collections.SparseArray.CreateItemHelper(ICreateItemCallback createItemCallback, Node node, Int32 nodeIndex, Int32 overallIndex)
at Infragistics.Windows.DataPresenter.MainRecordSparseArray.ToArray(Boolean create)
at Infragistics.Windows.DataPresenter.MainRecordSparseArray.EnsureAllItemsCreated()
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.EnsureFiltersEvaluated()
at Infragistics.Windows.DataPresenter.DataRecord.EnsureFiltersEvaluated()
at Infragistics.Windows.DataPresenter.Record.InternalIsFilteredOutHelper(Boolean verify)
at Infragistics.Windows.DataPresenter.Record.DirtyFilterState(Boolean reevaluate)
at Infragistics.Windows.DataPresenter.Record.DirtyFilterState()
at Infragistics.Windows.DataPresenter.RecordManager.OnDataChanged_DirtyFiltersHelper(DataChangeType dataChangeType, FieldLayout fl, DataRecord recordContext, Field fieldContext)
at Infragistics.Windows.DataPresenter.RecordManager.OnDataChanged(DataChangeType dataChangeType, DataRecord recordContext, Field fieldContext)
at [MASKED].OnListChanged(ListChangedEventArgs e_) in [MASKED]
at [MASKED].SyncDoCollectionActionInternal(NotifyCollectionChangedEventArgs args_) in [MASKED]
at [MASKED].SyncDoCollectionAction(Object state_) in [MASKED]
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.SafeNativeMethods.MessageBox(HandleRef hWnd, String text, String caption, Int32 type)
at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon)
at [MASKED].App.OnStartup(StartupEventArgs e_) in [MASKED]
at System.Windows.Application.<.ctor>b__0(Object unused)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunInternal(Window window)
at [MASKED].App.Main() in [MASKED]
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Hello,
We manage to track the error down and this appears to be the result of other issue. The issue is already fixed and will be included in the next service release. More details about the service release dates can be found here:http://es.infragistics.com/support/default.aspx#ServiceReleases
I hope this helps.
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Hello Ahmed,
I have created support case for you CAS-47759-TSMBMJ, so I will appreciate if you send me any other information, code snipped, samples that will help me to reproduce and investigate this issue.
Thank you.
Dimi,
The UI doesn't directly delete records ... As I mentioned before, the grid is connected to pub/sub system which updates the iBindingList which is attached to the grid. In this instance the publisher issued a delete row instruction to delete a record which has 3 chid records. The publisher normally removes children before deleting the parent. In this instance an exception was thrown when it attempted to delete the first child. This is currently captured in VS debugger and I have a full Stack Trace and a DataRecord snapshot which shows dataRecordIndex = -1, the rest of the properties in the DataRecords are correctly populated.
To answer your other questions, the application is mult-threaded but we have not dectected any race conditions in the publisher. Each user/client connects seperately publisher and has seperate instance of the data set, so I wouldn't worry too much about synchronising with other users
I'm not sure how to attach this information (stack trace and Datarecord snapshot). Can you please get in touch with me directly and I'll share the logs. We're also trying to contact the account manager to see if we can arrange your team to debug online as its impossible to create a sample project.