Ia it possible to use a FileUpload control in a RowEditTemplate? If so, can you provide the
RowEditingClientBinding code?
Thanks, Dave
Hello Dave,
“WebUpload” control can be used in row editing template. You can set it like shown in the following links:
http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Editing-and-Selection/Custom-Edit-Row-Template/Default.aspx?cn=data-grid&sid=2b41bfab-614a-4021-a526-b80e6ebf8b5b
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/WebDataGrid_Using_Client_Bindings.html
As for the bindings – what kind of the upload properties you need to set/get by client bindings?
Alex, I'd like to upload an "Image" and insert/update to a SQL Server table.
Currently (from version 11.1 to version 12.1) uploaded file is saved on the Hard Disk. In version 12.2 it is planned to add functionality that will allow file to be saved in the stream.
What you can do in the current situation is to handle Server-Side click event of the template “OK” button.
When this button is clicked the file (in your case image) should be uploaded. For instance in Client-Side you should disable OK button while uploading and when file is uploaded or canceled enable it again.
Also you should attach to Server-Side FileFinishing event (of the “WebUpload”) where you can save file path into Session.
When button OK is clicked then you should get file from saved in Session file path and save it into SQL (and to delete it from hard disk).
If you cancel row editing template (press Cancel button) then you could just delete uploaded file or (if the file is still uploading) to cancel upload process.
I hope that by following these steps you will be able to achieve the described scenario.
If you have further questions let me know.