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:
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.