Mouse Wheel Scrolling causes Overflow


When I quickly scroll a DataGrid which is virtualizing rows I get the following:
System.OverflowException: Arithmetic operation resulted in an overflow.
at System.IntPtr.op_Explicit(IntPtr value)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 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, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
I'm running on Vista x64.
If I don't scroll quickly, it doesn't happen.
If I don't use virtualization, it doesn't happen.
It is not dependant on what is happening to the grid at the time (i.e. if it is being updated)
I've attached a project that reproduces the issue.
Just build/run and quickly move mouse scroll wheel down.

file attachments


VamseeP wrote Aug 28, 2009 at 8:57 PM

Unfortunately I could not repro this. Can you provide us with more details which you think would be relevant.

pbrumblay wrote Dec 31, 2009 at 3:32 PM

I can reproduce this on Windows 7 x64 [Version 6.1.7600] using WPFToolkit.dll version 3.5.40128.1 and the attached solution. We are also seeing this in our application ...

serhhio wrote Mar 14, 2011 at 12:48 PM

we can reproduce this on Windows 7 x64. Please tell us if there are a workaround. Apparently the problem appears only with the scoll DOWN....

lil3p wrote Aug 29, 2011 at 12:16 PM

I am having exactly the same error the only difference is that am using a win forms, both the .net datagridview and developer express datagrid give an “Arithmetic operation resulted in an overflow” exception when I use the mouse wheel to scroll quickly on windows 7 64 bit. Was this issue ever resolved if so what’s the fix.