I trying to implement radasyncupload control inside radgrid.
I declare the upload control like:
I trying to validate that when UploadedFiles.Count == 0 i send a DBNull to database, and if UpladedFiles.Count > 0 i send the image uplaoded.
This it's fine, but if i upload a file, then i delete the uploaded file, when i proceed to submit the record, I detect that UploadedFiles.Count = 1
I need to know how can decrease the UploadedFiles.Count every time when i delete a uploaded file.
I found a similar problem in the post: RadAsyncUpload does not clear uploaded files.
I'm using the version Q1 2010, and i need to find a solution for this problem.
NOTE: I found a similar problem in your Upload / Using RadAsyncUpload in an Ajaxified Grid example. If you add a image, then you delete the image, and then you proceed to add the record, One row in the grid it's deleted. If you repeat the operation to upload and delete more files, then produce a error.
I appreciated your time and your answer.
Regards,
Felipe Meléndez.
I declare the upload control like:
<telerik:GridTemplateColumn DataField=
"usrSignature"
EditFormColumnIndex=
"0"
HeaderText=
"<%$ Resources:Localization, usrSign%>"
UniqueName=
"usrSignature"
>
<ItemTemplate>
<telerik:RadBinaryImage runat=
"server"
ID=
"rb"
DataValue=
'<%#Eval("usrSignature") is DBNull ? null : Eval("usrSignature")%>'
AutoAdjustImageControlSize=
"false"
Height=
"30px"
Width=
"100px"
AlternateText=
"<%$ Resources:Localization, NoSignature %>"
/>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadAsyncUpload ID=
"raupSignature"
runat=
"server"
AllowedFileExtensions=
"bmp,gif,jpg,jpeg,png"
MaxFileInputsCount=
"1"
/>
</EditItemTemplate>
</telerik:GridTemplateColumn>
I trying to validate that when UploadedFiles.Count == 0 i send a DBNull to database, and if UpladedFiles.Count > 0 i send the image uplaoded.
if
(usrSignature.UploadedFiles.Count > 0)
scmQuery.Parameters[
"@usrSignature"
].Value = DBNull.Value;
else
{
UploadedFile file = usrSignature.UploadedFiles[0];
byte
[] fileData =
new
byte
[file.InputStream.Length];
file.InputStream.Read(fileData, 0, (
int
)file.InputStream.Length);
scmQuery.Parameters[
"@usrSignature"
].Value = fileData;
}
This it's fine, but if i upload a file, then i delete the uploaded file, when i proceed to submit the record, I detect that UploadedFiles.Count = 1
I need to know how can decrease the UploadedFiles.Count every time when i delete a uploaded file.
I found a similar problem in the post: RadAsyncUpload does not clear uploaded files.
I'm using the version Q1 2010, and i need to find a solution for this problem.
NOTE: I found a similar problem in your Upload / Using RadAsyncUpload in an Ajaxified Grid example. If you add a image, then you delete the image, and then you proceed to add the record, One row in the grid it's deleted. If you repeat the operation to upload and delete more files, then produce a error.
I appreciated your time and your answer.
Regards,
Felipe Meléndez.