I followed the example online to download the attachment from a grid with a GridAttachmentColumn but I can't get the download working. The postback fires, ajax disables but the file is not sent. I am using Entity Framework.
<
telerik:RadGrid
AutoGenerateColumns
=
"False"
AutoGenerateDeleteColumn
=
"True"
AutoGenerateEditColumn
=
"True"
DataSourceID
=
"EntityAttachmentsDataSource"
ID
=
"EntityAttachmentsGrid"
OnDeleteCommand
=
"EntityAttachmentsGrid_OnDeleteCommand"
OnInsertCommand
=
"EntityAttachmentsGrid_OnInsertCommand"
OnItemCommand
=
"EntityAttachmentsGrid_OnItemCommand"
OnUpdateCommand
=
"EntityAttachmentsGrid_OnUpdateCommand"
runat
=
"server"
>
<
MasterTableView
DataKeyNames
=
"Id"
DataSourceID
=
"EntityAttachmentsDataSource"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Id"
DataType
=
"System.Int32"
HeaderText
=
"Id"
ReadOnly
=
"True"
UniqueName
=
"Id"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"FileName"
HeaderText
=
"FileName"
UniqueName
=
"FileName"
ReadOnly
=
"true"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridAttachmentColumn
DataSourceID
=
"EntityAttachmentDataSource"
MaxFileSize
=
"1048576"
EditFormHeaderTextFormat
=
"Upload Attachment:"
HeaderText
=
"Attachment"
HeaderTooltip
=
"Download Entity Attachment"
AttachmentDataField
=
"Attachment"
AttachmentKeyFields
=
"Id"
FileNameTextField
=
"FileName"
DataTextField
=
"FileName"
UniqueName
=
"InfringmentAttachment"
>
</
telerik:GridAttachmentColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnCommand
=
"GridOnCommand"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
<
asp:EntityDataSource
ConnectionString
=
"name=MyEntities"
DefaultContainerName
=
"MyEntities"
EnableFlattening
=
"False"
EntitySetName
=
"EntityAttachments"
EntityTypeFilter
=
"EntityAttachment"
ID
=
"EntityAttachmentsDataSource"
runat
=
"server"
>
</
asp:EntityDataSource
>
<
asp:EntityDataSource
ConnectionString
=
"name=MyEntities"
DefaultContainerName
=
"MyEntities"
EnableFlattening
=
"False"
EntitySetName
=
"EntityAttachments"
EntityTypeFilter
=
"EntityAttachment"
ID
=
"EntityAttachmentDataSource"
runat
=
"server"
Where
=
"it.[Id] = @Id"
Select
=
"it.[Attachment]"
>
<
SelectParameters
>
<
asp:Parameter
Name
=
"Id"
Type
=
"Int32"
/>
</
SelectParameters
>
</
asp:EntityDataSource
>
I disabled ajax fine (ConditionalPostback, etc.) and can upload no worries. But I can't get the attachment to download direct from the datasource. All the examples I can find are for SqlDataSource.
Richard