UNABLE TO SEE PROGRESS BAR WHEN CALLED ASYNCHRONOUSLY

Thread is closed for posting
2 posts, 0 answers
  1. SUBBU
    SUBBU avatar
    10 posts
    Member since:
    Apr 2012

    Posted 10 Apr 2012 Link to this post

    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

  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 13 Apr 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top