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

Uploading cancel.

1 Answer 34 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 11 Sep 2013, 09:21 AM
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. 

1 Answer, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 16 Sep 2013, 05:32 AM
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 >>
Tags
Upload
Asked by
Pavel
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Share this question
or