impliment radprogressarea

2 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 09 Jan 2013 Link to this post

    how to impliment radprogressarea to the asyncupload on a tooltip?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Jan 2013 Link to this post

    Hi,

    Here is the sample code that I tried to show the RadProgressArea inside a RadToolTip on click of a Button.

    ASPX:
    <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="AsyncUpload1">
        <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
        <telerik:RadProgressArea ID="RadProgressArea1" runat="server">
        </telerik:RadProgressArea>
    </telerik:RadToolTip>
    <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" MultipleFileSelection="Automatic" />
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" />

    C#:
    protected void Button1_Click(object sender, 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);
            }
        }

    Regards,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top