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

Manipulating selectedFiles collection

11 Answers 164 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Lars Solberg
Top achievements
Rank 1
Lars Solberg asked on 29 Oct 2008, 06:34 PM
Hi,

I'm looking to make a pdf upload application that allows the user to reorder the files (the order they get uploaded is important to our process) in the selectedFiles collection before uploading.  Ideally I would like the user to select the files, view the collection (as well as preview the pdfs), have the ability to reorder, and then upload.

I was hoping I could programmatically set the selectedFile collection, but it doesn't appear that I can do that and also I can't find a way to get the path to the selected file (so i can build a preview).  Any ideas on how i may be able to accomplish this?

Thank you very much.

11 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 01 Nov 2008, 09:38 AM
Hello Lars,

The re-ordering of the items is not supported at this moment - but it is a good idea to enable it to be done programmaticallt at least. We will see what we can do after the official release next week.

To get the info about the selected files you can use the events that are exposed from the RadUpload control. Check-out this example to see which events are available:
http://demos.telerik.com/silverlight/#Examples/Upload/Events

Let us know if you need any other functionality to be enabled in the RadUpload for your scenario.

Greetings,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dan
Top achievements
Rank 1
answered on 03 Nov 2008, 01:36 PM
Thanks for the quick reply.  We are trying to get this project done as quickly as possible and it would be very useful to be able to do at least one of these:

a.  Reorder the selectedFile collection
b.  Set the selectedFile collection programmatically
c.  Have the option of copying the files to silverlight's isolated storage before uploading as is done in this example http://www.silverlightexamples.net/post/Open-File-Dialog-in-Silverlight.aspx.  This would enable us to do all the client side manipulation we would need to.

Thanks again and I look forward to your response,

Lars
0
Valentin.Stoychev
Telerik team
answered on 03 Nov 2008, 01:47 PM
Hi Lars,

1. We can give you the ability to reorder the selectedFiles collection.

2. You will not be able to set the collection programmatically. There is a security restriction behind this - we are not allowed to access the file system. We can do that only by using the OpenFileDialog class that can be manupulated only from the end - user - you can't select the files programmatically. Once again - this is a Silverlight limitation that we can not workaround. 

3. You can do this even now - just handle the FilesSelectedEvent and you have access to the selected files streams that you can manipulate, save to isolated storage, etc ...

Thanks!

Greetings,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dan
Top achievements
Rank 1
answered on 15 Dec 2008, 03:42 PM
Hi Valentin...

We are starting this project up again and I wanted to follow up and see if we now have the ability to reorder the selectedFiles collection.

Thanks a lot,

Lars
0
Valentin.Stoychev
Telerik team
answered on 15 Dec 2008, 05:48 PM
Hello Lars,

no, we haven't worked on that. What is the time frame that you would need this feature?

Kind regards,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dan
Top achievements
Rank 1
answered on 16 Dec 2008, 01:46 PM
Hi Valentin,

Thanks for the quick response.  We were hoping to get this done soon, and I know its unrealistic to expect a new feature to be implemented in time.  I think i have a work around though, and if you'd be willing to help it would alleviate the need for the reordering functionality.  When the FilesSelected event is fired I populate a List of the filenames from the selectedFiles collection and set it as the itemSource of a reorderable listbox.  Then on RadUpload1_FileUploadStarting, I'd like to get the index of the current filename to be uploaded from the listbox and add it as a FileParameter to be interpreted/ordered by the raduploadhandler.  Unfortunately this is my first silverlight project and I'm not sure how to go about making a reorderable listbox.  Any ideas?

Thanks again,

Lars
0
Valentin.Stoychev
Telerik team
answered on 18 Dec 2008, 12:04 PM
Hello Lars Solberg,

Instead of reordable listbx you can use a RadTreeView - it has support for drag/drop of the items, so it is ok to re-order the items by using our TreeView.

To turn on the drag/drop of the treeview please see this example:
http://demos.telerik.com/silverlight/#TreeView/DragDrop

Sincerely yours,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul Tracy
Top achievements
Rank 1
answered on 17 Jul 2009, 12:56 PM

Hi,

The RadUpload tool, particularly the multiple file functionality is really good.  However, I am also looking at uploading multiple files with the need to upload in a specified order to be user defined on the client side.  Is there any update on whether this functionality is being looked at to be released in the near future?  Also, though not pressing, as I have seen mentioned in another thread the ability to append more files rather than having to add all files again would be good.

 

If not, the idea of using the drag/drop version of the RadTreeView might work, do your dev team have any examples of this working in conjunction with the RadUpload that I could steal???

Many Thanks

Paul

0
Ivan
Telerik team
answered on 17 Jul 2009, 03:22 PM
Hello Paul,

In current implementation the upload-order depends on ascending name order of valid files and can not be modified.

Sincerely yours,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Matthew
Top achievements
Rank 1
answered on 18 Jun 2010, 05:15 PM
What if the end user has already performed the file selection, and I save the (RadUploadSelectedFile)e.SelectedFiles.FirstorDefault() from within FilesSelected(sender, e) to an array.  Why can't I programmatically set a new RadUpload control's SelectedFiles items to each RadUploadSelectedFile in my array, and just fire StartUpload().

We have a need for the end user to separately select files for upload (such as an icon and later down the form an associated program) then submit to begin the upload.  There exists a button to select an icon (or not), and another to select a cutom program to upload; we use radupload's dialog to do file selection because we want to use it for uploading in the end.  On FileSelected I add the RadUploadSelectedFile from the EventArg to a global array, then remove and add a new instance of radUpload (because I can't clear the list - cancelupload doesn't work either, or manipulate the buttons to show browse again instead of addnewfiles) - BTW radupload control is in a ChildWindow in xaml.  Unless we remove the upload control and create new with our required settings, the old control is still there with original xaml settings, and the old file list.  Anyway, this repeats for the user to select an associated program.  When the end user has entered other form data, and clicks submit, we are trying to consolidate all SelectedFiles into one raduploadcontrol, and fire StartUpload - because "Upload" isn't visible until a file has been selected.

Is there something I'm missing?  Is it still a security issue to apply an array of end-user-selectedFiles from one radUpload control to another radUpload control programmatically?

Please help. Thank you,
Matthew
0
Valentin.Stoychev
Telerik team
answered on 18 Jun 2010, 05:21 PM
Hi Matthew,

This is currently not supported. But we have in our todo list to add an option for users to add programaticaly files to upload.

Best wishes,
Valentin.Stoychev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Upload
Asked by
Lars Solberg
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Dan
Top achievements
Rank 1
Paul Tracy
Top achievements
Rank 1
Ivan
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or