We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

OnMouseWheel crash with OutOfRange exception

Here's the setup, we have a SeriesCollection with a preview and a chart linked to it.
When we click on the preview it open up the chart.
the next step is to build the chart, once it is built we then want to zoom with the mouse wheel which throws and exception,
BUT if instead of directly zooming we close the chart, and then re-open it via the preview the zoom will work as expected.

Here is the exception thrown : {"Index was out of range. Must be non-negative and less than the size of the collection. \r\nParameter name: index"}
its StackTrace :  
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
   at Syncfusion.UI.Xaml.Charts.ChartZoomPanBehavior.MouseWheelZoom(Point mousePoint, Double direction)
   at Syncfusion.UI.Xaml.Charts.ChartZoomPanBehavior.OnMouseWheel(MouseWheelEventArgs e)
   at Syncfusion.UI.Xaml.Charts.SfChart.OnMouseWheel(MouseWheelEventArgs e)
   at CanmetENERGY.IBioref.UI.Views.Charts.SfChartCanMet.OnMouseWheel(MouseWheelEventArgs e) in c:\Code\IBIOREF\trunk\IBioref\UI\Views\Charts\SFChartCanMet.cs:line 20
   at System.Windows.UIElement.OnMouseWheelThunk(Object sender, MouseWheelEventArgs e)
   at System.Windows.Input.MouseWheelEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
   at System.Windows.Window.ShowDialog()
   at CanmetENERGY.IBioref.UI.Views.DialogView.CanmetENERGY.Common.Presentation.IDialogView.ShowDialog(ViewModelBase viewModel, String title) in c:\Code\IBIOREF\trunk\IBioref\UI\Views\DialogView.xaml.cs:line 30
   at CanmetENERGY.IBioref.Presentation.ViewModels.Charts.ChartsViewModel.ShowChartBuilder() in c:\Code\IBIOREF\trunk\IBioref\Presentation\ViewModels\Charts\ChartsViewModel.cs:line 158
   at CanmetENERGY.IBioref.Presentation.ViewModels.Charts.ChartsViewModel.AddNewChart() in c:\Code\IBIOREF\trunk\IBioref\Presentation\ViewModels\Charts\ChartsViewModel.cs:line 138

Any idea of what could cause this ?

3 Replies

SS Suresh S Syncfusion Team January 20, 2015 11:14 AM UTC

Hi Alexandre,

Thanks for using Syncfusion products.

We have analyzed the reported issue “Exception thrown on mouse wheel zoom” and we are unable to reproduce the issue with our current version. Could you please provide details regarding the Syncfusion assembly version you are using?

Also, the issue “Exception thrown while zooming the chart without chart series” have been fixed in our 2014 Vol2 (12.2 version) itself. If you are using lower version please upgrade our latest version 12.4.


Suresh S

AH Alexandre Huard January 20, 2015 04:42 PM UTC

Hi Suresh,

Thank you for the answer,
We are currently using the version
We tested with the latest version (12.4) and the exception is now gone and the zoom is working as expected.
We will fully upgrade soon.


SS Suresh S Syncfusion Team January 21, 2015 08:40 AM UTC

Hi Alexandre,

Thanks for your response.

We are glad to know that issue is resolved at your end. Please let us know if you require any further assistance.


Suresh S

Live Chat Icon For mobile
Up arrow icon