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

Cannot upload when embedded in ElementHost

5 Answers 66 Views
CloudUpload
This is a migrated thread and some comments may be shown as answers.
Einar
Top achievements
Rank 1
Einar asked on 10 Nov 2014, 08:40 PM
Hello,

I am trying to use the CloudUpload within an ElementHost. When I choose a file and then click upload I get the following error:

Object reference not set to an instance of an object.
   at Telerik.Windows.Cloud.Controls.Upload.CloudUploadFile.UpdateCommandsCanExecute()
   at Telerik.Windows.Cloud.Controls.Upload.CloudUploadFile.SetState(CloudUploadFileState value)
   at Telerik.Windows.Cloud.Controls.Upload.CloudUploadFile.StartUpload()
   at Telerik.Windows.Cloud.Controls.RadCloudUpload.StartUpload(IEnumerable`1 items)
   ...

I'm setting up the CloudUpload like so:

            var upload = new RadCloudUpload();
            upload.Name = "radCloud1";
            upload.Provider = new DummyProvider();
            elementHost1.Child = upload;
 
 To confirm that I wasn't setting it up incorrectly I tried the same code without the element host and it works fine. Is the ElementHost unsupported?




5 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 13 Nov 2014, 03:17 PM
Hello Einar,

Unfortunately, I must confirm that an exception is thrown in the described set up.

The reason for this is that internally the RadCloudUpload uses ClouduploadFile objects (as upload workers). The CloudUploadFile exposes a few commands, like the StartUploadCommand. When a command changes its CanExecute state, we invoke the CanExecuteChanged handler of the worker. The change of the CanExecute state may very well happen in a background thread, but the CanExecuteChanged invocation needs to happen on the UI thread. This is why we now use the Application.Current.Dispatcher to dispatch the invocation. In win forms, there is no Application.Current, hence the exception.

We understand that this is pretty inconvenient and we will investigate the possibilities of removing this limitation. Unfortunately, we cannot offer a work-around at this moment, we hope that you can wait for the next SP (out in early December). I have updated your Telerik points as a thank you for letting us know of this issue.

Regards,
Petar Marchev
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
Petar Marchev
Telerik team
answered on 13 Nov 2014, 03:23 PM
Aaaand a link to the issue here, if you want to keep track.
0
Einar
Top achievements
Rank 1
answered on 13 Nov 2014, 08:20 PM
Hello Petar,

Thank you much for your reply. Much appreciated.

Petar - are you able to confirm whether or not this will be resolved in the early-December SP? Either way is fine - but knowing the estimated delivery time for this feature will determine whether or not we need to look at alternative libraries to accomplish the desired functionality we're looking for.

Thank you,

Einar
0
Petar Marchev
Telerik team
answered on 14 Nov 2014, 02:39 PM
Hello Einar,

Our development team informed me that this was swiftly taken care of and there is a fix for it already. You can download the LIB and see if indeed the issue is resolved. The LIB will be out on Monday, November 17th. Info here.

Regards,
Petar Marchev
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
Einar
Top achievements
Rank 1
answered on 14 Nov 2014, 04:26 PM
Hello again Petar,

This was really good news to receive. We'll test the LIB on Monday or Tuesday.

Thanks again,

Einar
Tags
CloudUpload
Asked by
Einar
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Einar
Top achievements
Rank 1
Share this question
or