I am using the background worker class in VS 2005. The worker's job is to get the data from the server every so often and update the grid data. Everything works fine. However, when user interacts with the grid layout i.e resize columns, grouping column, an exception is thrown. I tried the same code with MS data grid and the problem does not occur. Here's the code snippet.
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
thdProcessing.RunWorkerAsync()
End Sub
Private Sub thdProcessing_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles thdProcessing.DoWork
While True
thdProcessing.ReportProgress(0, mobjConnection.Conductor.GetAllTasks)
Threading.Thread.Sleep(5000)
End While
End Sub
Private Sub thdProcessing_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles thdProcessing.ProgressChanged
Telerikgrid.DataSource = e.UserState
DataGridView1.DataSource = e.UserState
End Sub
Here's the call stack of the exception
" at Telerik.WinControls.UI.GridHeaderRowElement.OnMouseUp(MouseEventArgs e)\r\n at Telerik.WinControls.RadElement.OnCLREventsRise(RoutedEventArgs args)\r\n at Telerik.WinControls.RadElement.OnBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadItem.OnBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.UI.GridRowElement.OnBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)\r\n at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)\r\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n at Telerik.WinControls.RadControl.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(ApplicationContext context)\r\n at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()\r\n at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()\r\n at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)\r\n at CivilAutoManagerDeveloperEdition.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
thdProcessing.RunWorkerAsync()
End Sub
Private Sub thdProcessing_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles thdProcessing.DoWork
While True
thdProcessing.ReportProgress(0, mobjConnection.Conductor.GetAllTasks)
Threading.Thread.Sleep(5000)
End While
End Sub
Private Sub thdProcessing_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles thdProcessing.ProgressChanged
Telerikgrid.DataSource = e.UserState
DataGridView1.DataSource = e.UserState
End Sub
Here's the call stack of the exception
" at Telerik.WinControls.UI.GridHeaderRowElement.OnMouseUp(MouseEventArgs e)\r\n at Telerik.WinControls.RadElement.OnCLREventsRise(RoutedEventArgs args)\r\n at Telerik.WinControls.RadElement.OnBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadItem.OnBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.UI.GridRowElement.OnBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)\r\n at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)\r\n at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)\r\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n at Telerik.WinControls.RadControl.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(ApplicationContext context)\r\n at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()\r\n at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()\r\n at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)\r\n at CivilAutoManagerDeveloperEdition.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"