This demo: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandradasyncupload/defaultcs.aspx?product=upload
Has the following
.... yet RadAsyncUpload does not contain an OnValidatingFile event. Theres code written to it in the code-behind as well.
This demo here:
http://www.telerik.com/help/aspnet-ajax/grid-binaryimage-radasyncupload.html
Has the same flaw but actually writes logic tied to it ( See: IsRadAsyncValid ). Also, a CustomValidator is dynamically created during ItemCreated when the AsyncUpload itself is simply sitting in an EditItemTemplate of a TemplateColumn. The Custom Validator does not need to be dynamic.
When you guys get some time, can you unify your demo's and come up with some best practices for RadAsyncUpload when used inside of a grid?
For now, here's what I take away from it:
Has the following
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"AsyncUpload1"
OnClientFileUploaded
=
"OnClientFileUploaded"
AllowedFileExtensions
=
"jpg,jpeg,png,gif"
MaxFileSize
=
"1048576"
OnValidatingFile
=
"RadAsyncUpload1_ValidatingFile"
>
</
telerik:RadAsyncUpload
>
.... yet RadAsyncUpload does not contain an OnValidatingFile event. Theres code written to it in the code-behind as well.
This demo here:
http://www.telerik.com/help/aspnet-ajax/grid-binaryimage-radasyncupload.html
Has the same flaw but actually writes logic tied to it ( See: IsRadAsyncValid ). Also, a CustomValidator is dynamically created during ItemCreated when the AsyncUpload itself is simply sitting in an EditItemTemplate of a TemplateColumn. The Custom Validator does not need to be dynamic.
When you guys get some time, can you unify your demo's and come up with some best practices for RadAsyncUpload when used inside of a grid?
For now, here's what I take away from it:
- Keep a Custom Validator with client side validation tied to the RadAsyncUploadControl to prevent the page from submitting until any current upload operations are finished
- If you are in an ajax grid, you may as well enable onFileUploaded to .ajaxRequest() and clear ( radAsyncUpload.deleteFileinputAt(0) ) the 'queue'.
- During Insert/Update get a reference to the async upload and check for UploadedFiles.