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

how to handle the upload cancel event

9 Answers 200 Views
Upload
This is a migrated thread and some comments may be shown as answers.
anirudha
Top achievements
Rank 1
anirudha asked on 07 Apr 2009, 11:35 AM
Hi All,

I am using telerik radupload control for uploading files.
I need to handle the file upload Cancel event.
is there any way to do this?

Thanks
Anirudha

9 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 07 Apr 2009, 03:28 PM
Hi anirudha,

In order to handle the UploadCanceled event you should implement an event handler. Bellow are samples in Xaml and C#:

XAML:
<telerik:RadUpload  
    UploadCanceled="radUpload_UploadCanceled" 
    x:Name="radUpload" 
/> 

C#:
private void radUpload_UploadCanceled(object sender, System.EventArgs e)  
{  

Inside the handler's body you can cast the sender to the RadUpload type.

All the best,
Ivan
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Alex
Top achievements
Rank 1
answered on 23 Sep 2009, 04:19 AM
The UploadCanceled event is not firing in Q2. The upload does get cancelled but radUpload_UploadCanceled is never called
0
Ivan
Telerik team
answered on 24 Sep 2009, 12:28 PM
Hello Alex,

Thank you for reporting the issue.

Here we do some tests and everything looks OK. We attached our test application here. Please give it a try.

If the problem still exists in your application please send it to us for further investigation.

Greetings,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sir
Top achievements
Rank 1
answered on 13 Aug 2010, 12:23 AM
I'm also having the same issue -
I'm on version 2010.2.714.1040
Is there any known issues?
Clicking "Cancel" does clear the upload item list but does not fire my RadUploadImport_UploadCanceled event.
it does fire all the other events listed below:
<telerik:RadUpload x:Name="RadUploadImport" 
                   Style="{StaticResource RadUploadStyleDocType}"
                   ItemContainerStyle="{StaticResource RadUploadItemStyleDocType}"
                   UploadCanceled="RadUploadImport_UploadCanceled"
                   UploadStarted="RadUploadImport_UploadStarted"
                   FileUploadStarting="RadUploadImport_FileUploadStarting"
                   FileUploaded="RadUploadImport_FileUploaded" 
                   UploadFinished="RadUploadImport_UploadFinished"
                   LayoutUpdated="RadUploadImport_LayoutUpdated"
                   Grid.Column="0" 
                   Grid.Row="2">
</telerik:RadUpload>
0
Miro Miroslavov
Telerik team
answered on 17 Aug 2010, 12:20 PM
Hi Sir,

We have known bug related to UploadCanceled event - your problem is related to this one and is not fixed yet. You can track it's progress to get notifications when it is fixed.
Thank you for your patience.


Kind regards,
Miro Miroslavov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kirk Quinbar
Top achievements
Rank 1
answered on 09 Dec 2010, 06:24 PM
I am currently using Q3 2010 release of your silverlight controls and this problem still seems to be present. Is this supposed to be fixed where if I press the Cancel button before uploading, that it throws the UploadCancelled event? for ui purposes, i have a need to know when the user cancels the upload whether its currently in progress or hasnt started.

also, after an upload is complete and how can i programmatically reset the upload control so it looks like it did the first time the user gets to the page. I've tried doing radupload.items.clear() and also radupload.cancelupoad(); and neither completely reset it back to it default view.

Kirk
0
Alex Fidanov
Telerik team
answered on 15 Dec 2010, 09:01 AM
Hi Kirk Quinbar,

The UploadCancelled event is designed to be raised only when a started upload session has been stopped. If an upload session has not been started, then this event would not be raised. What you can do is modify the default style of the RadUpload and either bind the Command of the Cancel button to a custom one or handle its Click event so that you know when this button has been cancelled. Then you can add your custom code and call Upload.CancelUpload() method.

Greetings,
Alex Fidanov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Alex Fidanov
Telerik team
answered on 15 Dec 2010, 09:07 AM
Hello Kirk Quinbar,

In regards to restoring the initial state of the RadUpload - calling RadUpload.CancelUpload() method should be doing this. I tested this with the online samples and the state is restored correctly. Is it possible to provide us with screenshots of the initial state and the one after calling CancelUpload() on your end?

Regards,
Alex Fidanov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Kirk Quinbar
Top achievements
Rank 1
answered on 15 Dec 2010, 02:24 PM
thanks for the idea of writing a custom cancel event. i will have to give that a try.

as far as the CancelUpload method not resetting things, now i cant seem to recreate what i was seeing before, so i guess its solved. we ended up going a different route anyways with the page, so its not such a big deal.

Kirk
Tags
Upload
Asked by
anirudha
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Alex
Top achievements
Rank 1
Sir
Top achievements
Rank 1
Miro Miroslavov
Telerik team
Kirk Quinbar
Top achievements
Rank 1
Alex Fidanov
Telerik team
Share this question
or