A System.ArgumentOutOfRangeException
was raised due to a wrong index used for accessing an item in a DataGrid
(happened on a shipped version and no user-interaction was made).
Following a portion of the stacktrace we received:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at System.Windows.Media.VisualCollection.get_Item(Int32 index)
at System.Windows.Controls.UIElementCollection.get_Item(Int32 index)
at System.Windows.Controls.UIElementCollection.System.Collections.IList.get_Item(Int32 index)
at System.Windows.Controls.DataGridCellsPanel.ArrangeOverride(Size arrangeSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
[...]
Further down the stacktrace we could also see that virtualization was active for the DataGrid
where the exception was thrown. Most likely the error has something to do with deferred loading/virtualization, however, where it happened is still a mystery.
Is it possible to configure WPF or manually add information to track down where an exception was thrown? (at least which class/control/page/window, possibly even which binding)