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

How to return to initial status after upload a file

1 Answer 60 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chen
Top achievements
Rank 1
Chen asked on 26 Jun 2012, 03:25 PM
Hi

I just start to use this control and have an issue about it.

My case is very simple. I only allow users to upload one file at a time, so when the upload finished, I want to change the radupload control to its initial status, which means the file progress bar, total progress bar and the cancel button should be hidden, only the browse button shows up.

Is there any way to do it?

Thanks in advance for any input.

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 28 Jun 2012, 02:51 PM
Hi Chen,

You can use the RadUpload.CancelUpload() method (read more) to reset the upload control's state. You only have to make sure that when you call this method, the upload process and session are completely finished and the state of the control reflects that. This is why if you decide to handle he RadUpload.UploadFinished event to reset its state, you need to delay the execution of the CancelUpload() method. For example you can invoke the method in a Dispatcher:
private void RadUpload1_UploadFinished(object sender, RoutedEventArgs e)
{
    Dispatcher.BeginInvoke(() =>
    {
        (sender as RadUpload).CancelUpload();
    });
}

Give this a try and let us know if it helps or if you have any other questions regarding the RadUpload control.

Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Upload
Asked by
Chen
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or