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

UNABLE TO SEE PROGRESS BAR WHEN CALLED ASYNCHRONOUSLY

1 Answer 97 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
SUBBU
Top achievements
Rank 1
SUBBU asked on 10 Apr 2012, 03:31 PM

Hi,


I have created a custom progress bar usercontrol using RadProgressArea. I have placed this control in one of my web page. On a button click event a usercontrol method will be triggered. This method in turn will trigger the UpdateProgressContext method for setting the Radprogresscontext.  The progress percentage will be retrieved using progressMethod. The RadProgressBar is getting displayed.
But if I try to call the UpdateProgressContext method asynchronously using delegate, my progressbar itself is not displayed. This is my code.

private delegate void BeginProgress(Progress prog); 

public Update(Progress progressMethod)
{
    BeginProgress beginUpdate = new BeginProgress(UpdateProgressContext);
  
    beginUpdate.BeginInvoke(progressMethod, new AsyncCallback(ProgressCallbackMethod), new object());
}
  
private void UpdateProgressContext(Progress progressMethod)
{
            int currentPercentage = 0;
            const int total = 100;
            while (currentPercentage <= 100)
            {
  
                currentPercentage = progressMethod();
  
                radProgress.Speed = "N/A";
                radProgress.PrimaryTotal = 1;
                radProgress.PrimaryValue = 1;
  
                radProgress.PrimaryPercent = 100;
  
                radProgress.SecondaryTotal = total;
  
                radProgress.SecondaryValue = currentPercentage;
                radProgress.SecondaryPercent = currentPercentage;
  
                radProgress.CurrentOperationText = "Step " + currentPercentage.ToString();
  
                radProgress.TimeEstimated = (total - currentPercentage) * 100;
            }
        }

Any help will be appreciated. Thanks in advance.

Regards,
Subbu

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 13 Apr 2012, 12:13 PM
Hi Subramanian,

I don't believe that this is a supported scenario using RadProgressArea. The current mechanism of RadProgressArea relays on updating the progress context synchronously.

All the best,
Genady Sergeev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Upload (Obsolete)
Asked by
SUBBU
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or