This is a migrated thread and some comments may be shown as answers.

RadProgressArea shows only elapsed time

1 Answer 110 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Skylon
Top achievements
Rank 1
Skylon asked on 02 Dec 2011, 03:24 PM
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

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 07 Dec 2011, 12:20 PM
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
Tags
Upload (Obsolete)
Asked by
Skylon
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or