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

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

2 Answers 38 Views
Upload
This is a migrated thread and some comments may be shown as answers.
danparker276
Top achievements
Rank 2
danparker276 asked on 31 Mar 2014, 07:03 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Vandov
Telerik team
answered on 03 Apr 2014, 08:12 AM
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
Telerik
 

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.

 
0
danparker276
Top achievements
Rank 2
answered on 03 Apr 2014, 07:06 PM
Ah, I guess that would work too.
I like this solution in this post thought:
http://www.telerik.com/forums/raduploaditem-validate-question#NQbWRJhwc0OVHk0VkJT4Vg
Tags
Upload
Asked by
danparker276
Top achievements
Rank 2
Answers by
Kiril Vandov
Telerik team
danparker276
Top achievements
Rank 2
Share this question
or