RadProgressArea shows only elapsed time

Thread is closed for posting
2 posts, 0 answers
  1. Skylon
    Skylon avatar
    3 posts
    Member since:
    Feb 2011

    Posted 02 Dec 2011 Link to this post

    Using your simple example "Monitoring Custom Progress" does not update anything but elapsed time. 
    http://demos.telerik.com/aspnet-ajax/upload/examples/customprogress/defaultcs.aspx

    However, the codebehind runs and when completed the progress UI disappear as expected.
    Changing the Culture sometimes makes the progress UI show the complete progress.
    Stopping the debug and rerun the same code will not show progress.

    My current Culture is da-DK, changing the page culture to en-US does not do the trick though.
    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Upload2.aspx.cs" Inherits="PackageManagement.Pages.Common.Upload2" UICulture="en" Culture="en-US" %>

    Please advise. My code:
    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Upload2.aspx.cs" Inherits="PackageManagement.Pages.Common.Upload2" UICulture="en" Culture="en-US" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
     
        <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"
            Culture="en-US" DisplayCancelButton="True" HeaderText="Uploading files" />
        <br /><br /><br /><br /><br /><br />
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    </asp:Content>
    Codebehind:

    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 PackageManagement.Pages.Common
    {
        public partial class Upload2 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, System.EventArgs e)
            {
                if (!IsPostBack)
                {
                    //Do not display SelectedFilesCount progress indicator.
                    RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount;
                    //RadProgressArea1.Culture = System.Globalization.CultureInfo.CurrentCulture;
                    //RadProgressArea1.Culture = new System.Globalization.CultureInfo("da");
                }
                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();
            }
     
            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)
                    {
                        //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);
                }
            }
     
        }
    }

    Current version is 2011.3.1115.40
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 07 Dec 2011 Link to this post

    Hello Mads,

    I've prepared a sample web site based on the code provide with the exact version of the controls that you are using and the progress parameters are updated properly on my side.

    I'm sending the web site so you could test it locally. In case it's working properly on your side as well, open a support ticket and provide a runnable version of your project with the issue being reproduced.

    All the best,
    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
Back to Top