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

RadUpload Doesn't Upload When Inside Busy RadBusyIndicator

3 Answers 53 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Brian Sayatovic
Top achievements
Rank 1
Brian Sayatovic asked on 23 Jul 2013, 02:25 PM
I have a RadUpload control hosted inside a window that wraps everything in a RadBusyIndicator.  When the user starts the upload through my command, I make the busy indicator busy and then call StartUpload().  However, StartUpload() is silently short-circuiting.  Debugging, I've found my RadUpload.IsEnabled is false, which is a short-circuit condition inside StartUpload().

I found in this other post -- http://www.telerik.com/community/forums/silverlight/busy-indicator/radbusyindicator-and-isenabled.aspx -- that indeed, when a RadBusyIndicator is set to busy -- all of its contents are marked as not enabled (IsEnabled=false).

How can I work around this?

FWIW, I can see RadUpload.UploadCommand wanting to honor IsEnabled since commands are specifically intended to be used with UI controls; however, StartUpload() is a programmatic method that can be triggered any number of ways (such as my case).  Why does StartUpload() need to check IsEnabled?  Why not let the UploadCommand's CanExecute() honor it but let StartUpload() always load it?

3 Answers, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 24 Jul 2013, 10:47 AM
Hello Brian,

The StartUpload() of the RadUpload control is designed to be executed only when the control is enabled. That is why when you place the RadUpload inside RadBusyIndicator the upload is not started. However you could workaround this issue by placing the RadUpload control above the RadBusyIndicator not inside its Content, like follows:
<Grid >
    <StackPanel>
        <telerik:RadUpload />
        <Button Content="START UPLOAD" Click="Button_Click" />
    </StackPanel>
    <telerik:RadBusyIndicator x:Name="indicator" />
</Grid>
I hope this information helps.

Kind 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 >>
0
Brian Sayatovic
Top achievements
Rank 1
answered on 24 Jul 2013, 12:39 PM
It only confirms what I suspected -- RadUpload doesn't function when disabled.  Not even it's non-UI functionality such as actually starting the upload.

My entire 1M+ lines-of-code application is built with hundreds of dialogs that busy when an action button is executed, including one where we're trying to use RadUpload.  The idea is to "lock down" the UI elements inside the dialog while the action is executing.  So the sequence is:

  1. Lock down dialog
  2. Call RadUpload.StartUpload()
  3. ...
  4. Unlock dialog

So my problem is that I can't easily take the RadUpload control out of my dialog framework.  What's more, I don't want to.  I won't want the control to be modifiable while the upload processing is underway (this includes some pre-work I must do before the actual upload starts).

Is there no other alternative?

Also, can Telerik please reconsider blocking StartUpload with IsEnabled?  Just block the UploadCommand's CanExecute method (since that is what people will bind to the UI) and leave StartUpload() to actually do the upload regardless of IsEnabled (since that is what people with more complex integration needs will rely upon).
0
Tina Stancheva
Telerik team
answered on 29 Jul 2013, 01:58 PM
Hello Brian,

Unfortunately as the StartUpload() method is the only method that triggers an upload and as it is currently designed to upload files only when the control is enabled, I can't suggest any workarounds. The only way to make the control upload its selected files is to make sure it isn't disabled. For instance you can try to set its Opacity to only make it look disabled. If that is also not an option for you, you can create a second RadUpload control that works behind the scenes - it can take the original RadUpload.CurrentSession.SelectedFiles and upload them.

As I can understand that these workarounds aren't what you're looking for and as I can see your point on this matter, I logged your suggestion in our PITS. We will definitely discuss such a change and we will also track the demand for this task and prioritize it accordingly.

Regards,
Tina Stancheva
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
Brian Sayatovic
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Brian Sayatovic
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or