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

show progress in tooltip

1 Answer 57 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Sathish
Top achievements
Rank 1
Sathish asked on 04 Dec 2012, 08:20 AM
Hi,

Has anyone tried to implement radprogressarea on radasyncupload as a TOOLTIP? so when files are being uploaded, I want to mouse over it and get additional details as to estimated time of completion, rate of upload etc.

Can someone point me in the right direction as to how to get started or provide an example? I think this will be a cool thing to have inbuilt by Telerik as well.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 04 Dec 2012, 09:15 AM
Hi Sathish,

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);
        }
    }

Please elaborate your scenario if it doesn't helps.

Regards,
Princy.
Tags
AsyncUpload
Asked by
Sathish
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or