This is a migrated thread and some comments may be shown as answers.

[Solved] Attachment Column not functioning

6 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 27 Jul 2011, 08:12 PM
I have an attachment column in my radgrid that has stopped functioning properly and I can't seem to figure out why.

                    <telerik:GridAttachmentColumn ButtonType="ImageButton" ImageUrl="~/Images/pdf_icon.gif" DataSourceID="odsLetter"  HeaderImageUrl="~/Images/pdf_icon.gif" HeaderTooltip="Download Letter"
DataTextField="FileName" AllowFiltering="false" AttachmentDataField="FileBLOB" AttachmentKeyFields="HTC_Key" FileNameTextField="FileName" UniqueName="Letter" SortExpression="LetterReleased">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridAttachmentColumn>

I have the oncommand event set to run the gridCommand function to disable AJAX for the download.

<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
    <script type="text/javascript">
<!--
        function gridCommand(sender, args) {
            if (args.get_commandName() == "DownloadAttachment") {
                var manager = $find('<%= RadAjaxManager.GetCurrent(Page).ClientID %>');
                manager.set_enableAJAX(false);
 
                setTimeout(function () {
                    manager.set_enableAJAX(true);
                }, 0);
            }
        }
 
   -->
    </script>
</telerik:RadCodeBlock>

The grid loads and displays the right filename as a tooltip over the icon when I hover with my mouse which leads me to believe that the keyfields linkage is working right.  When I click the download icon, the page does a postback and reloads the grid without downloading the file from the BLOB field.

Any ideas about why this is happening this way?

Thanks

Mike

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 04 Aug 2011, 10:25 AM
Hello Mike,

I'm not sure what causes the problem thus I created a simple demo that uses a similar approach. Please test it on your end and see how it differs from your code. This may help you find the issue.

Regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
asimptota
Top achievements
Rank 1
answered on 26 Feb 2013, 09:51 AM
Hi, I know it's been a while since last post but, could you provide the same sample with EntityDataSource?
0
Daniel
Telerik team
answered on 01 Mar 2013, 12:22 PM
Hi Jasmin,

I have attached a modified version of the previous example here. I hope this will be a good starting point for you.

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
asimptota
Top achievements
Rank 1
answered on 01 Mar 2013, 12:26 PM
Thank you very much for your answer. But, I've managed to make it work by myself :) Unfortunately, now I have problem that I've described in this thread http://www.telerik.com/community/forums/aspnet-ajax/grid/gridattachmentcolumn-with-editmode-inplace.aspx
Could you please help me with this one? :)
0
Daniel
Telerik team
answered on 06 Mar 2013, 09:23 AM
Hello Jasmin,

My colleague Kostadin will take care of this case. Please stick to the original thread.

Thanks,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
asimptota
Top achievements
Rank 1
answered on 06 Mar 2013, 10:42 AM
Thank you very much. I'll be waiting.
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Daniel
Telerik team
asimptota
Top achievements
Rank 1
Share this question
or