Hello,
I'm getting the InvalidOperationException whenever I scroll in an UltraGrid.
It happens randomly when I'm scrolling, especially if I hold down the mouse button over the scroll bar background to get the scroll bar to move to that location.
Nothing is being called when I scroll, just a cross thread issue between winforms and the grid
Here is the exception:
System.InvalidOperationException HResult=0x80131509 Message=Cross-thread operation not valid: Control 'ugData' accessed from a thread other than the thread it was created on. Source=System.Windows.Forms StackTrace: at System.Windows.Forms.Control.get_Handle() at System.Windows.Forms.Control.PointToClientInternal(Point p) at System.Windows.Forms.Control.PointToClient(Point p) at Infragistics.Win.ButtonUIElementBase.VerifyMouseOverButton() at Infragistics.Win.ScrollButtonUIElement.n(Object ) at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state) 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.TimerQueueTimer.CallCallback() at System.Threading.TimerQueueTimer.Fire() at System.Threading.TimerQueue.FireNextTimers() at System.Threading.TimerQueue.AppDomainTimerCallback()
Any ideas? Thanks!
Hello Brandon,
Please provide a sample demonstrating this behavior. Are you actually updating the UI on a background thread? That could lead to issues. However we might be doing somethings to the scrollbar internally that might be interfering, something of which we could take a look at if we had a sample from you. Thanks.
Which version of our controls are you using?
I'm using version 1.0.5005.47 and nothing is using or updating the table except onFormLoad() for initialization and the click event handler for the cells, which are not being triggered. It happens when I hold click on the scroll bar above or below the scroll knob.
Let us know if you would like help upgrading. Have a great weekend.
Well that would explain it! Guess it's time to update. According to my boss, it was in place before he started 13 years ago. Thanks for the help.
Brandon Coon said:I'm using version 1.0.5005.47
Are you sure that's the version of the UltraWinGrid? That version would be over 19 years old. :)
Thank you for your reply. Please send us a sample that demonstrates the behavior. Let me know if you've tried swapping with a MS grid and seeing if that also exhibits the same behavior.
I believe this only happens in debug mode as indicated by this thread here: https://es.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/16036/ultragrid-crashing-when-scrolling
However, no solution was implemented.