views:

28

answers:

2

I have a RadGrid with a custom edit form (FormTemplate). The grid is in an UpdatePanel for asynchronous postbacks, as changing the selection in drop down lists and checkboxes needs to enable or disable other controls on the form. (Updating the controls synchronously is not acceptable to the user.)

As part of the edit form, I have a FileUpload control, but this does not upload the files when in an update panel.

I have tried adding the Insert/Update button as a PostBackTrigger on the UpdatePanel, but this causes an error on page load, as the UpdatePanel cannot find the control (the edit form is not open on load).

Is there a way to add/remove the trigger at runtime when the form is opened/closed? Or is it possible to have the FileUploads work with the async-postback?

A: 

Yes, you have problem with is as FileUpload is in the list of controls that are not compatible with update panel (for more info here). One workaround for you could be swfupload. Another option is to use this jQuery plugin http://www.plupload.com/example_all_runtimes.php as stated here

Teddy
A: 

There is a demo on the Telerik site that shows how to upload the files.

By using a RadAjaxPanel, RadCodeBlock and RadScriptManager with RadUploads instead of FileUploads it is possible to detect on the client side whether files have been selected for upload. If there are files to upload, the AJAX postback can be disabled during the upload.

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=upload&RadUrid=cde8a81e-0eb1-49ca-8c31-4dba37da90c4

Mark Cheeseborough