Tuesday, June 25, 2013

RadGrid download attachment doesnt work inside Ajax panel

If your download button inside the RadGrid doesnt work if in an ajax panel:
 All you have to do is below( "btnDownload" is the id of the control
 which causes the download):
 
       function RequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("btnDownload") >= 0) {
                args.set_enableAjax(false);
            }
        }
 
<telerik:RadAjaxPanel runat="server" LoadingPanelID="pnlLoading" 
ID="pnlMain" ClientEvents-OnRequestStart="RequestStart">
 

  <telerik:GridTemplateColumn HeaderText="Business Card" >
      <ItemTemplate>
    <asp:LinkButton runat="server" ID="btnDownload" Text="Download" 
CommandName="Download" CommandArgument='<%#Eval("ID"%>'    >
    </asp:LinkButton>
       </ItemTemplate>
 </telerik:GridTemplateColumn>

No comments:

Post a Comment