RadProgress bar fails to update.

2 posts, 0 answers
  1. JUSTIN
    JUSTIN avatar
    1 posts
    Member since:
    May 2011

    Posted 20 Dec 2012 Link to this post

    I'm not understanding why it fails to update in another thread correctly if the process is running fast. Example

    If I do this, this will freeze the progress bar until its completed. It will get to a certain spot then stop.
    radProgressBar2.Maximum = 1500;
    for (var i = 1; i < 1500; i++)
    {
        var p = i;
        radProgressBar2.Value1 = p;
        Thread.Sleep((int)numericUpDown1.Value);
    }
    radProgressBar2.Value1 = 0;
    radProgressBar2.Text = "Task Completed!";


    If i do this 

    radProgressBar1.Maximum = 1500;
    for (var i = 1; i < 1500; i++)
    {
        var p = i;
        radProgressBar1.SafeInvoke(() => radProgressBar1.Value1 = p, false);
        Thread.Sleep((int) numericUpDown1.Value);
    }


    using a custom invoke it works just fine. I dont understand why it doesnt work correctly with the build in feature. This is also happening on the status progress bar as well.. Here is a quick app source.

    Also it seems to work with the built in features using Win7 or above, Its freezing on windows xp sp3 


    Edit: Never mind i can not attach rar, or .zip to this thread. 

    Uploading a video to demonstrate.
  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 25 Dec 2012 Link to this post

    Hello Justin,

    Thank you for writing.

    The reason why the progress bar does not update when you are doing something in the UI thread is because it has to recalculate its layout and then draw itself. It is always advisable to perform long running tasks in a background thread. As to the difference between XP and Win 7, there are differences in the lifecycle and message processing of applications in the different operating systems.

    I hope this clears things up. If you need further assistance, I would be glad to help.
     
    All the best,
    Ivan Petrov
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top