Clear upload control filelist

2 posts, 0 answers
  1. Sunitha
    Sunitha avatar
    1 posts
    Member since:
    Feb 2012

    Posted 25 Oct 2012 Link to this post

    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

  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 30 Oct 2012 Link to this post

    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.

  3. DevCraft banner
Back to Top