How to show progress bar in inside of radwindow ?

3 posts, 2 answers
  1. Aravind
    Aravind avatar
    41 posts
    Member since:
    Jun 2013

    Posted 15 Aug 2013 Link to this post

    Hai
      I need to show the progress bar inside the radwindow ,if i click button it will take 1 to 2 mins for processing,so i need to show the progress bar when page is refreshed .

    Regards
      Aravind
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Aug 2013 Link to this post

    Hi Aravind,

    Please try the following code snippet that I have tried.

    ASPX:
    <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true">
        <ContentTemplate>
            <telerik:RadButton ID="buttonSubmit" runat="server" Text="Start Processing" OnClick="buttonSubmit_Click">
            </telerik:RadButton>
            <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
            <telerik:RadProgressArea ID="RadProgressArea1" runat="server" />
        </ContentTemplate>
    </telerik:RadWindow>

    C#:
    protected void buttonSubmit_Click(object sender, System.EventArgs e)
    {
            UpdateProgressContext();
    }
    private void UpdateProgressContext()
    {
        const int total = 100;
     
        RadProgressContext progress = RadProgressContext.Current;
        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)
            {
                break;
            }
     
            progress.TimeEstimated = (total - i) * 100;
            //Stall the current thread for 0.1 seconds
            System.Threading.Thread.Sleep(100);
        }
    }

    Let me know if it doesn't help you.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 16 Aug 2013 Link to this post

    Hi guys,

    I would also advise on taking a look at the following thread that shows a different, easier approach: http://www.telerik.com/community/forums/aspnet-ajax/window/blocking-a-radwindow-while-processing.aspx. Nevertheless, if the expected delay is, indeed, several minutes, the progress area could be the better approach as it shows a more detailed indicator.


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
Back to Top