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

Grid

2 Answers 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
manoj
Top achievements
Rank 1
manoj asked on 21 Oct 2010, 06:41 PM

Hi All,

I have a ajaxified Radgrid, having some columns,
there is one button column for file dowwnload.
when we hit that button
the files from server should get downloaded.

But due to ajaxification, we are not able to download the files.
If i remove the radajaxmanager then i am able to download the files.

protected void GrdDocs_OnItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "Download")
            {
              GridDataItem item = e.Item as GridDataItem;
              string filePath = item["FILEPATH"].Text;
               string filename = Path.GetFileName(filePath);

               Response.ClearContent();
               Response.Clear();
               Response.ContentType = "application/zip";
               Response.AppendHeader("content-disposition", "attachment; filename=" + filename);

               try
                 {
                    //RadAjaxManager1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", filePath));
                    Response.TransmitFile(filePath);
                    Response.Flush();
                    //Response.End();
                           
                 }
              catch(exception e)
              {
              }
            }

}

------------------

In ASCX page

<telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Download" HeaderText="AVAILABLE FILES"
Text="Download" UniqueName="FILEPATH">                           
</telerik:GridButtonColumn>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Submit">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
   
</telerik:RadAjaxManager>

Note: The submit button is inside asp:updatePanel.

 

 

2 Answers, 1 is accepted

Sort by
0
manoj
Top achievements
Rank 1
answered on 22 Oct 2010, 03:45 AM
Hi All,

Please help me to resolve this issue.
0
Pavlina
Telerik team
answered on 22 Oct 2010, 01:45 PM
Hi Manoj,

Go through the help article below and let me know if it works for you.
Download files with ajaxified control

Greetings,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
manoj
Top achievements
Rank 1
Answers by
manoj
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or