how to handle the upload cancel event

10 posts, 0 answers
  1. anirudha
    anirudha avatar
    17 posts
    Member since:
    Jan 2009

    Posted 07 Apr 2009 Link to this post

    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
  2. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 07 Apr 2009 Link to this post

    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.
  3. DevCraft banner
  4. Alex
    Alex avatar
    54 posts
    Member since:
    Feb 2009

    Posted 22 Sep 2009 Link to this post

    The UploadCanceled event is not firing in Q2. The upload does get cancelled but radUpload_UploadCanceled is never called
  5. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 24 Sep 2009 Link to this post

    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.
  6. Sir
    Sir avatar
    31 posts
    Member since:
    Mar 2008

    Posted 12 Aug 2010 Link to this post

    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>
  7. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 17 Aug 2010 Link to this post

    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
  8. Kirk Quinbar
    Kirk Quinbar avatar
    48 posts
    Member since:
    Nov 2007

    Posted 09 Dec 2010 Link to this post

    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
  9. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 15 Dec 2010 Link to this post

    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
  10. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 15 Dec 2010 Link to this post

    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
  11. Kirk Quinbar
    Kirk Quinbar avatar
    48 posts
    Member since:
    Nov 2007

    Posted 15 Dec 2010 Link to this post

    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
Back to Top
DevCraft banner