I have a XamPivotGrid, which I've made editable.
When editing a value in the last column, I get an exception with the following stack trace. I haven't been able to trace it back to any of my code, although I'm not ruling out the possibility that I have an issue with my code. Mind taking a look to see if this info tells you anything I could be doing wrong? I cannot post my source, and I haven't been able to reproduce in a separate, simple app.
We are using the IG Dark Theme if that matters.
Exception Type: System.ArgumentOutOfRangeExceptionAssembly: System.ThrowHelper, mscorlib, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089Function: ThrowArgumentOutOfRangeException
Error: Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: indexStack Trace: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List`1.get_Item(Int32 index) at Infragistics.Controls.Grids.PivotDataColumnCollection.GetItem(Int32 index) at Infragistics.Collections.CollectionBase`1.System.Collections.IList.get_Item(Int32 index) at Infragistics.Controls.Grids.PivotColumnsPanel.EstimatePanelDesireSize() at Infragistics.Controls.Grids.PivotHeaderPanel.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at Infragistics.Controls.Grids.RowsView.MeasureInternal(Size availableSize) at Infragistics.Controls.Grids.RowsView.Measure(Size availableSize) at Infragistics.Controls.Grids.PivotGridPanel.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext 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.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context)
Update: We can reproduce this issue by scrolling all the way to the right, scrolling down and allowing the grid to resize itself, scrolling all the way to the new right, and selecting a cell. The exception is thrown sporadically when selecting interior cells, but it happens 100% of the time when selecting the right-most cell after the grid resizes itself.
Thank you for posting. I followed the steps you suggested and was unable to reproduce the behavior you're describing.
I created a sample of XamPivotGrid and made it editable, I also used IgTheme in my sample to verify if this is causing the issue but I didn't get any exception.
I run the attached sample, expand the ‘product all’ and try to edit the last column of seller and able to edit it with no exception. I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, then the change in behavior is due to differences in your environment from mine and these differences can be anything from operating system version to the specific version of the Infragistics DLL versions used. My test was performed using version 18.1.20181.105. Please provide more details about your machine and version of the assemblies that you are referencing so that I can modify the environment that I am testing in to match yours.
If the project does show the product feature working correctly, then more information will be needed to reproduce the issue in a sample that can be used for debugging. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing. This can be done by either making the sample that I provided more like your application or by isolating the behavior from your application by removing dependencies on any third parties or databases.
Please let me know if I can provide any further assistance.
Sincerely,Divya JainAssociate Software Developer
The problem is that we were calling an Infragistics pivot grid function in a non-UI thread without waiting for the UI to finish what it may have been doing.