Cannot upload when embedded in ElementHost

6 posts, 0 answers
  1. Einar
    Einar avatar
    19 posts
    Member since:
    Jul 2014

    Posted 10 Nov 2014 Link to this post

    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?




  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 13 Nov 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 13 Nov 2014 Link to this post

    Aaaand a link to the issue here, if you want to keep track.
  5. Einar
    Einar avatar
    19 posts
    Member since:
    Jul 2014

    Posted 13 Nov 2014 in reply to Petar Marchev Link to this post

    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
  6. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 14 Nov 2014 Link to this post

    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.

     
  7. Einar
    Einar avatar
    19 posts
    Member since:
    Jul 2014

    Posted 14 Nov 2014 in reply to Petar Marchev Link to this post

    Hello again Petar,

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

    Thanks again,

    Einar
Back to Top
UI for WPF is Visual Studio 2017 Ready