Hi,
We are using MVVM approach. I'm finding difficulty in implementing the MVVM approach to RadUpload control. I am able to clear the text boxes by setting null to the property.I have no idea how to achieve that for RadUpload.I want to clear the selected items and the progress bar using MVVM . Can you please help me to achieve.
5 Answers, 1 is accepted
Currently, the cancelation of the SelectedItems in the RadUpload cannot be achieved in a MVVM scenario. You can use the Clear() method of the Selectedtems collection in code behind like so:
this
.RadUpload1.SelectedItems.Clear();
Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
You cannot achieve much with the RadUpload in an MVVM way. You can explore this forum thread(there is a project attached) where its is shown how to bind the RadUpload.CanceCommand. Please elaborate more on your scenario and especially what you need to do in an MVVM way. We would be glad to advice you.
Best wishes,Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
(1) Upload the new file to Current Item on the screen - Store in List<bytes[]>
(2) To do that I have to get reference to viewmodel of the current screen (dont like referencing viewmodel in view) - getting DataContext of the viewmodel
(3) Save the file being uploaded currently selected item (one of the property of the viewmodel)
is there a workaround for this.. so I don't reference my viewmodel in the code behind?
Please advise
Thank You,
Do you need to save the files before uploading them? Because if you want to populate a view model with the byte stream of the uploaded files, you can customize the UploadHandler to save the uploaded files in a database and on the client-side use this database to populate a view model collection with the files.
Here you can find more information on how to customize the UploadHandler to save the uploaded files in a database. Please let me know if this scenario will work for you.
Regards,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>