Uploading cancel.

2 posts, 0 answers
  1. Pavel
    Pavel avatar
    10 posts
    Member since:
    Feb 2013

    Posted 11 Sep 2013 Link to this post

    Hi,
    is there any way to cancel uploading of files without clearing of filelist? 
    I mean for example I have some fields on the form with RadUploader and there are some validation errors on that fields. So I want to not allow to upload files while some errors are presented on the form.
    Thanks,
    Pavel. 
  2. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 16 Sep 2013 Link to this post

    Hello Pavel,

    The RadUpload is designed to clear its Items once the CancelUpload() is called in order the users to be able to directly select new files via the Browse button.

    In your scenario, you could use a boolean property which is binded to your textbox validation fields  and according to the input to Enable/Disable the Upload button. You can access the Upload button like follows:

    void RadUpload_Loaded(object sender, RoutedEventArgs e)
    {
        this.Dispatcher.BeginInvoke(new Action(() =>
            {
                this.uploadButton = this.ChildrenOfType<RadButton>().FirstOrDefault(x => x.Name == "UploadButton");
            }));
    }
    Another approach is to use the RadUploadItem validation, you could find more information about its usage here. However once the Item is marked as invalid you need to use the cancel button and browse the file again.

    I hope this information helps.

    Regards,
    Kiril Vandov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top