PauseUpload doesn't give the resume button on 1st attempt

3 posts, 1 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 31 Mar 2014 Link to this post

    So I'm checking for a textbox to be filled in (a description).  And if it's not filled I'm calling
    private void radUploadAttach_FileUploadStarting(object sender, Telerik.Windows.Controls.FileUploadStartingEventArgs e)
        if ((tbFileDesc.Text == null)|| (tbFileDesc.Text.Trim().Length < 1))
          writeErrorMessage("You must enter a description", borderMsg, txtMessage);
           Dispatcher.BeginInvoke(() => { radUploadAttach.PauseUpload(); });

    Now I should see a 'Resume' button on the upload control, but it goes to 'Browse' instead. (It looks like it might go from resume to browse really quickly).
    I don't see anywhere else in my code where I would change the state.

    Also if I do it a second time it works.  That is if I click browse after the failure and select a new or same file, then press upload.  I'll get the same error message, but this time I'll have a 'Resume' button there, so I can add my text and upload it without having to reselect it.
  2. Answer
    Kiril Vandov
    Kiril Vandov avatar
    323 posts

    Posted 03 Apr 2014 Link to this post

    Hello Dan,

    The Browse buttons of the RadUpload is displayed because the uploading session is not started and until you press the upload button or start the session the pause button will not be displayed. The FileUploadStarting event is fired once a file is queued  for upload, not when the upload action is started.
    However you can use the  IsAutomaticUpload property of the RadUpload and set its value to true, doing so the upload will automatically start uploading its files once you select them. Your logic will kick in and the session will be paused, leaving only the Resume button visible.

    I hope this information helps.

    Kind regards,
    Kiril Vandov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
  4. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 03 Apr 2014 in reply to Kiril Vandov Link to this post

    Ah, I guess that would work too.
    I like this solution in this post thought:
Back to Top