Need Help on RadProgressArea

Thread is closed for posting
2 posts, 0 answers
  1. Han
    Han avatar
    13 posts
    Member since:
    Dec 2010

    Posted 19 Jan 2012 Link to this post


    Can you show me how to use RadProgressArea while loading data from a sql server?  Here is my scenario:

    I have a RadButton.  when a user click on this button, I have a function call RetrieveData() and this function will connect to a sql database and query about 100,000 records and performing a lot of data manipulation so it will take awhile to produce desire data.

    while processing the data, I would like to display like a progress bar so user can see what's going on and wait.  I found the demo here: and really like it, but I don't know how to apply it to my scenario.  From the example, it sets the total process = 100, but in my case, my query run can take up to 3 minutes.  Please provide code as possible.  Here is my code behind page:

    protected void Page_Load(object sender, EventArgs e)
            if (!IsPostBack)
                //Do not display SelectedFilesCount progress indicator.
                RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount;
            RadProgressArea1.Localization.Uploaded = "Total Progress";
            RadProgressArea1.Localization.UploadedFiles = "Progress";
            RadProgressArea1.Localization.CurrentFileName = "Please wait while updating database... ";

    protected void RetrieveData()
            //using LINQ to SQL to select data

    private void UpdateProgressContext()
            RadProgressContext progress = RadProgressContext.Current;
            const int total = 100;
            progress.Speed = "N/A";
            for (int i = 0; i < total; i++)
                progress.PrimaryTotal = 1;
                progress.PrimaryValue = 1;
                progress.PrimaryPercent = 100;
                progress.SecondaryTotal = total;
                progress.SecondaryValue = i;
                progress.SecondaryPercent = i;
                progress.CurrentOperationText = "Step " + i.ToString();
                if (!Response.IsClientConnected)
                    //Cancel button was clicked or the browser was closed, so stop processing
                progress.TimeEstimated = (total - i) * 100;
                //Stall the current thread for 0.1 seconds

    protected void RadButton1_Click(object sender, EventArgs e)
           UpdateProgressContext(); //I assume this is how it call
    Please help, thanks in advance!
  2. Bozhidar
    Bozhidar avatar
    1146 posts

    Posted 19 Jan 2012 Link to this post

    Hello Han,

    I've already answered you in the other forum thread, so you can check the reply there.
    All the best,
    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
Back to Top