Custom RadProgressArea - still shown even after completion of the task

6 posts, 0 answers
  1. Vijay
    Vijay avatar
    5 posts
    Member since:
    Oct 2011

    Posted 29 Dec 2011 Link to this post

    Hi,

    Im trying to use RadProgressArea to show a progress bar for custom DB task. It shows up and the progress is shown.
    The issue is after completion of task, it still shows up and doesnt hide.

    If i remove the RadAjaxManager updating the panel, then on completion of task the RadProgressArea goes off.


    Following is the code snippet for my aspx and code behind
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="ProgressBarSample.WebForm4" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
         <telerik:RadScriptManager id="ScriptManager1" runat="server" />
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="buttonSubmit">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" IsSticky="true">
        </telerik:RadAjaxLoadingPanel>
                <asp:Panel runat="server" ID="Panel1">
                    <asp:Label ID="lbl1" runat="server"></asp:Label>
                </asp:Panel>
                <asp:button ID="buttonSubmit" runat="server" Text="Submit" OnClick="buttonSubmit_Click" CssClass="RadUploadButton" />
                 
                <telerik:RadProgressManager id="Radprogressmanager1" runat="server" />
                 
                <telerik:RadProgressArea id="RadProgressArea1" runat="server" />
                 
                <br /><br /><br /><br /><br /><br />
        </div>
        </form>
    </body>
    </html>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
    using Telerik.Web.UI.Upload;
     
    namespace ProgressBarSample
    {
        public partial class WebForm4 : System.Web.UI.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 = "Custom progress in action: ";
            }
            protected void buttonSubmit_Click(object sender, System.EventArgs e)
            {
                UpdateProgressContext();
                lbl1.Text = "Updated";
            }
     
            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;
                    int per = Convert.ToInt32((Convert.ToDouble(i) / total)*100);
                    UpdateProgress(progress,total,i,per);
                    progress.CurrentOperationText = "Step " + i.ToString() + " Per = " + per.ToString();
     
                    if (!Response.IsClientConnected)
                    {
                        //Cancel button was clicked or the browser was closed, so stop processing
                        break;
                    }
     
                    progress.TimeEstimated = (total - i) * 100;
                    //Stall the current thread for 0.1 seconds
                    System.Threading.Thread.Sleep(100);
                }
            }
            private void UpdateProgress(RadProgressContext progress,int total,int i,int per)
            {
     
                    progress.SecondaryTotal = total;
                    progress.SecondaryValue = i;               
                    progress.SecondaryPercent = per;
            }
        }
    }
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 03 Jan 2012 Link to this post

    Hi,

    When using Ajax please make sure that the RadProgressManager along with the RadProgressArea are both in the updated controls list of your RadAjaxManager as shown below:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
               <AjaxSettings>
                   <telerik:AjaxSetting AjaxControlID="buttonSubmit">
                       <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="Panel1" />
                           <telerik:AjaxUpdatedControl ControlID="Radprogressmanager1" />
                           <telerik:AjaxUpdatedControl ControlID="RadProgressArea1" />
                       </UpdatedControls>
                   </telerik:AjaxSetting>
               </AjaxSettings>
           </telerik:RadAjaxManager>

    Regards,
    Dimitar Terziev
    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
  4. David Cowan
    David Cowan avatar
    22 posts
    Member since:
    Nov 2009

    Posted 03 Feb 2012 Link to this post

    I was having the same problem described and the solution above helps but does not solve the problem.   After adding my RadAjaxProgressManager and RadProgressArea to my RadAjaxManagerProxy


    <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="toolBarMain">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="progressManager" />
                    <telerik:AjaxUpdatedControl ControlID="progressAreaMain"/>                   
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    I now get the proper behavior of the progress bar hiding on completion in chrome, but not in Firefox or IE.  In Firefox or IE I just get a flash like the progress bar goes away and then immediately comes back.  I am on 2011.3.1305
  5. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 08 Feb 2012 Link to this post

    Hi David,

    Please open a support ticket and provide a runnable sample page with the issue being reproduced so I could inspect it locally.

    All the best,
    Dimitar Terziev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Lillian
    Lillian avatar
    1 posts
    Member since:
    Oct 2013

    Posted 03 Oct 2013 Link to this post

    Hi

    Has there been any solution to this please?

    I am having the exact same problem. I use RadProgressArea and RadProgressManager for a DB task. I have added them as UpdatedControls into  RadAjaxManager, but when the task is completed  the RadProgressArea flashes and appears again.

    Thank you
  7. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 08 Oct 2013 Link to this post

    Hi Lillian,

    Look at this article, it describes how to hide the progress area automatically after the progress is completed. If it doesn't help try to call the stopAsyncPolling() method of the RadProgressManager:
    $find('RadProgressManager1').stopAsyncPolling();

    Regards,
    Hristo Valyavicharski
    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
UI for ASP.NET Ajax is Ready for VS 2017