Hello,
I'm trying to implement the use of a GridBinaryImageColumn + GridBinaryImageColumnEditor to automatically manage the upload of an image into a RadGrid-
Data comes from custom classes, images come from a blob field in db and are rendered properly in grid; however, when I edit the record and try to upload a new image, my GridBinaryImageColumnEditor always tells it cannot find any uploaded file.
My grid:
Code:
I don't get any error in itemcommand, but always get 0 files (and editor.UploadedFileContent.Length=0). The same update command is working properly with other database fields, which I can update: what am I missing to properly handle file upload?
Thanks for any hint,
al.
I'm trying to implement the use of a GridBinaryImageColumn + GridBinaryImageColumnEditor to automatically manage the upload of an image into a RadGrid-
Data comes from custom classes, images come from a blob field in db and are rendered properly in grid; however, when I edit the record and try to upload a new image, my GridBinaryImageColumnEditor always tells it cannot find any uploaded file.
My grid:
<
telerik:RadGrid
ID
=
"grdLinee"
runat
=
"server"
AutoGenerateColumns
=
"false"
AllowAutomaticUpdates
=
"false"
AllowSorting
=
"true"
AllowPaging
=
"true"
PageSize
=
"10"
OnNeedDataSource
=
"grdLinee_NeedDataSource"
AllowAutomaticInserts
=
"true"
AllowAutomaticDeletes
=
"false"
OnItemCommand
=
"grdLinee_ItemCommand"
OnSelectedIndexChanged
=
"grdLinee_SelectedIndexChanged"
AllowFilteringByColumn
=
"false"
MasterTableView-EditMode
=
"InPlace"
ShowHeader
=
"true"
ShowFooter
=
"true"
ShowStatusBar
=
"true"
Skin
=
"Office2007"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
ClientSettings
AllowKeyboardNavigation
=
"true"
EnablePostBackOnRowClick
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"idCatalogoLinee"
CommandItemDisplay
=
"Top"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
></
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
Text
=
"Delete"
CommandName
=
"Delete"
ButtonType
=
"ImageButton"
ConfirmText
=
"Sei sicuro?"
/>
<
telerik:GridBinaryImageColumn
DataField
=
"immagine"
UniqueName
=
"immagine"
ResizeMode
=
"Fit"
DataType
=
"System.Byte"
></
telerik:GridBinaryImageColumn
>
//...
Code:
protected
void
grdLinee_ItemCommand(
object
sender, GridCommandEventArgs e)
{
switch
(e.CommandName)
{
case
"Update"
:
GridBinaryImageColumnEditor editor = (GridBinaryImageColumnEditor)item.EditManager.GetColumnEditor(
"immagine"
);
//editor.RadUploadControl.UploadedFiles.Count here is always 0
//...
}
}
I don't get any error in itemcommand, but always get 0 files (and editor.UploadedFileContent.Length=0). The same update command is working properly with other database fields, which I can update: what am I missing to properly handle file upload?
Thanks for any hint,
al.