Hello!
I wasn't sure how to title my thread. I have a test case that I'm not sure how to handle appropriately.
I have the following control set up:
<
telerik:RadAsyncUpload
ID
=
"uploadControl"
runat
=
"server"
Skin
=
"MetroTouch"
UseApplicationPoolImpersonation
=
"true"
AutoAddFileInputs
=
"true"
InitialFileInputsCount
=
"1"
EnableInlineProgress
=
"true"
MultipleFileSelection
=
"Automatic"
MaxFileInputsCount
=
"5"
>
This control is in a RadWizard that saves each step incrementally (Next/Previous click, NavigationButton Click). The RadWizard's validation is triggered on the "Finish" button. I am using the MaxFileInputsCount property to determine how many files are required to pass validation - in the case above, the control needs 5 files to be uploaded to pass field validation on the "Finish" button click.
Here is the scenario that is causing me trouble:
Let's say I launch the RadWizard, go to the step with my upload control and only upload 2 of the 5 required files. I click "Next" and the 2 files are uploaded and their paths saved to the database. When I click "Finish", I get an error saying I can't submit because I need to upload 3 more files. This all works fine.
Now, I exit and relaunch the RadWizard to complete my form, and I go to the upload control step.
Currently, if I upload 2 out of 5 files, exit and go back in the application, I can upload another 5 files instead of just 3. How can I re-load the AsyncUpload control and add the 2 previously-uploaded files to the UploadedFileCollection() in order for the control to know that I need 3 more files before hiding the FileInput button and so that I can validate?
I hope that makes sense!
I tried setting the UploadedFiles() property of the AsyncUpload control as demonstrated below, but that property is read-only... and there is no "Add" function for the UploadeFilesCollection(), so obviously that code gives me a bunch of errors.
Dim
colFiles
As
Telerik.Web.UI.UploadedFileCollection()
For
Each
filename
In
arrUploadedFiles
Dim
objFile
As
Telerik.Web.UI.UploadedFile
objFile.FileName = strUploadPath & filename.ToString
colFiles.Add(objFile)
Next
uploadControl.UploadedFiles = colFiles