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

Clear upload control filelist

1 Answer 35 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Sunitha
Top achievements
Rank 1
Sunitha asked on 25 Oct 2012, 11:52 PM

Hi,

I am looking for a way to clear the files listed in the control after successful / unsuccessful upload . I need the conrol to look just like the way it looks before files are selected.  I would need a way to clear them programmatically any help is greatly appreciated.

Thanks,
Sonny

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 30 Oct 2012, 07:31 AM
Hello Sunitha,

To achieve you issue you can use the UploadFinished and FileUploadFailed events of the RadUpload control. When some of these events fire you can call the CalcelUpload method  and this will bring back the start view of the control. Here is a sample XAML code:

<telerik:RadUpload x:Name="xUpload" UploadFinished="xUpload_UploadFinished" FileUploadFailed="xUpload_FileUploadFailed"/>

And this is the code-behind:

private void xUpload_UploadFinished(object sender, System.Windows.RoutedEventArgs e)
{
    xUpload.CancelUpload();
}
 
private void xUpload_FileUploadFailed(object sender, FileUploadFailedEventArgs e)
{
    xUpload.CancelUpload();
}
Hope this is what you are looking for.

Regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Upload
Asked by
Sunitha
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or