This is a migrated thread and some comments may be shown as answers.

Radprogress bar not showing on long page executions

4 Answers 277 Views
ProgressArea
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 24 May 2016, 01:45 AM

I am trying to use the RadProgressArea to show a progress bar for processing 100,000+ records. 

It worked fine in my sample application but when deploying it failed to show.  I narrowed down the problem to tasks that occur prior to this progress bar loop that take upwards of 12 seconds.  Then after some testing I found that if I manually add a .Sleep() to the thread for anything more than 5 seconds (to simulate the delay) it would cause the RadProgressArea to not show at all.  Basically if I take the Telerik example and simply add a 6s delay in front of it then it never works.

Am I missing something obvious here?  Thank you in advance for my sanity.

System.Threading.Thread.Sleep(5000) ' ANYTHING 5s OR HIGHER MAKES PROGRESS BAR NEVER SHOW
 
' initialize variables
Dim progress As RadProgressContext = RadProgressContext.Current
 
' loop through records
For i As Integer = 0 To TotalRecords - 1
    ' update progress bar
    UpdateProgressBar(progress, dtStarted, TotalRecords, i)
 
    ' SOME WORK STUFF GOES HERE
Next

4 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 24 May 2016, 10:36 PM

Just a bump to see if I can get an answer on this for a time sensitive project. 

So ignoring the previous details, if I simply take the sample Telerik example at http://demos.telerik.com/aspnet-ajax/progressarea/ and add a 6 second delay *before* the logic takes place then the progress window never shows up.

Any help is greatly appreciated

Protected Sub buttonSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles buttonSubmit.Click
    UpdateProgressContext()
End Sub
 
Private Sub UpdateProgressContext()
    Const Total As Integer = 100
 
    'Stall the current thread for 6 seconds (THIS BREAKS THE PROCESS, NO WINDOW SHOWS UP)
    System.Threading.Thread.Sleep(6000)
 
    Dim progress As RadProgressContext = RadProgressContext.Current
    progress.Speed = "N/A"
 
    For i As Integer = 0 To Total - 1
        progress.PrimaryTotal = 1
        progress.PrimaryValue = 1
        progress.PrimaryPercent = 100
        progress.SecondaryTotal = Total
        progress.SecondaryValue = i
        progress.SecondaryPercent = i
        progress.CurrentOperationText = "Step " & i.ToString()
        progress.TimeEstimated = (Total - i) * 100
 
        'Stall the current thread for 0.1 seconds
        System.Threading.Thread.Sleep(100)
    Next
End Sub

 

0
Hristo Valyavicharski
Telerik team
answered on 26 May 2016, 08:57 AM
Hi John,

I have replied in the support ticket that you have opened.

Regards,
Hristo Valyavicharski
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Brian
Top achievements
Rank 1
answered on 11 Oct 2016, 08:36 PM
Would it be possible to post the answer for anyone else having similar issues?
0
Peter Milchev
Telerik team
answered on 14 Oct 2016, 01:28 PM
Hello Brian,

The problem is caused by the following bug: ProgressArea does not show if progress monitoring is delayed with 5 or more seconds. You could follow the item and this way you would know when the bug is fixed, as this will be reflected in the item's status.

Regards,
Peter Milchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ProgressArea
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
Brian
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or