Threading problem

4 posts, 0 answers
  1. phuong nguyen
    phuong nguyen avatar
    2 posts
    Member since:
    May 2006

    Posted 23 May 2007 Link to this post

    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()"
  2. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 24 May 2007 Link to this post

    Hello phuong nguyen,
    The problem you have experienced is fixed and the fix will be available in SP2 when released. We have fixed numerous other threading issues as well.

    Regards,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. PortVista
    PortVista avatar
    61 posts
    Member since:
    Oct 2006

    Posted 30 May 2007 Link to this post

    Wow wish I would have known this was broken too -- I wasted a few days on this before I had to go back and use the MS grid for threads.
  5. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 30 May 2007 Link to this post

    Hello Jason Honingford,
    As part of our commitment to increase dramatically the quality and the performance of our products towards the Q2 release, threading issues are addressed also. Apologies for the caused waste of time on the threading problems.

    Best wishes,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top