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

How to integrate Silverlight RadUpload with ASP.NET AJAX RadGrid?

3 Answers 128 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Rubens
Top achievements
Rank 1
Rubens asked on 16 Jun 2009, 03:17 AM
Hi All,

I'm trying to manage the following requirements for our application:

  • Select multiple files for upload at once (solved using Silverlight RadUpload)
  • Enter several information for each file, like description and a special tag (selected from a DropDownList)
  • Limit the upload bandwidth for the file upload
  • Show a progress bar with upload current status

 So, I'd imagine to :

  • Intercept the selecting event for Silverlight RadUpload
  • Define a GUID for each selected file
  • send an AJAX request with the filenames, GUID to server
  • refresh the RadGrid with the filenames, hiding the GUID
  • wait for user enter all the information and validate it
  • On a client Button_click event start the upload
  • When upload finishes, send all data on DataGrid to server
  • On a server-side event, match the guids and save all data

 

I'm check the feasibility of this integration. Is it possible? There's some examples showing how to do pieces of this implementation?

Thanks in advance,

Rubens  

3 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 16 Jun 2009, 07:28 PM
Hi Rubens,

It's nice to see you again.

About requirements for your application - we think it is possible to implement all of them with the RadUpload control. Below are some notes to your requirement's points:
  • Multiple files selection is available in RadUpload. Even more we already implement Add more files functionality and it is available with the latest internal build;
     
  • Till now the RadUpload does not implement the MVVM and extensions like editable form or grid are not available. But the RadUpload can workaround this issue with the help of:
    • Modification of the RadUploadItem's Template;
    • Sending custom parameters to the upload handler;
    This approach is demonstrated in the Add text field to each file selected ticket;
     
  • Limit the upload bandwidth for the file upload - this feature is not implement out of the box, but we already discussed it in your previous ticket. Let me inform you that we implement dynamic change of the uploader's BufferSize and now you can implement run-time negotiation between RadUpload control and its upload handler. We hope this feature will be available in the incoming internal release, of course after it conforms to the QA;
     
  • Feedback information is already available for both the upload process and each of uploaded files.
     
Please compare the information above with your task requirements and let me know if you need more assistance.

Kind regards,
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
Rubens
Top achievements
Rank 1
answered on 17 Jun 2009, 02:12 AM
Hi Ivan

It's nice to see you too!

So far, I can create an item on javascript and send it to a webmethod and refresh my RadGrid. I also have a "delete" column, removing it from list. Since almost everything with RadGrid is done, I went to RadUpload integration.

I read your Add text field to each file selected post but I think its not applicable to my scenario. I want to enter the data inside that RadGrid because I want to keep my validation controls and eventually use a RadEditor to allow the user to enter more info. The RadUpload control will be kept hide and I will interact with it throught javascript.

I was studying your implementation for SilverlightUpload and saw you expose OnClientFileUploaded, OnClientFilesUploadStarted and OnClientFilesUploadFinished events but its not enough. I need to be notified when the user select files, so I can create that entries on RadGrid with filename and size. Also, I need an way to remove a selected file, to match the delete button from that grid.

I was planning to create a GUID on client and use it as temporary filename; when all files upload finishes, I could match the filename with the other information and save it correctly on Sharepoint site. Since all metadata information (classification, description and more) can be long, I don't want to send this data over and over inside a CustomTag.

That's it. Please let me know what do you think about this.

Best regards,

Rubens

0
Ivan
Telerik team
answered on 18 Jun 2009, 12:36 PM
Hi Rubens,

One thing you need is the FilesSelected event. Please handle it and you will get the control over newly selected files. There are some more events that will help you deal with file related restrictions: FileTooLarge, FileCountExceeded, UploadSizeExceeded.

About deletion of an already selected item.
Use the RadUpload.CurrentSession.FileNameUploadItem to get the related RadUploadItem and then delete it from the RadUpload control:
 
if (this.radUpload.CurrentSession.FileNameUploadItem.ContainsKey(FileName)) 
   RadUploadItem item this.radUpload.CurrentSession.FileNameUploadItem[FileName]; 
   this.radUpload.Items.Remove(item); 
 
We hope this information will help you to accomplish your task. Of course if you have more questions please do not hesitate to contact us.
 
All the best,
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.
Tags
Upload
Asked by
Rubens
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Rubens
Top achievements
Rank 1
Share this question
or