Help with open & save dialog for downloading file from ext gridpanel

  1. #1

    Help with open & save dialog for downloading file from ext gridpanel

    ASPX Code

    <ext:GridPanel ID="grdDownload" runat="server" StoreID="StoreDownload" StripeRows="true"
    Height="430" Width="600px" Header="true" AutoShow="False" AutoScroll="True" >
    <ColumnModel ID="ColumnModel1" runat="server">
    <Columns>
    <ext:GroupingSummaryColumn ColumnID="CLATeamNo" Header="" Width="150" Sortable="true"
    DataIndex="CategoryName">
    </ext:GroupingSummaryColumn>
    <ext:GroupingSummaryColumn Header="" Width="130" Sortable="true" DataIndex="DisplayName">
    </ext:GroupingSummaryColumn>
    <ext:GroupingSummaryColumn Header="" Width="130" Sortable="true" DataIndex="Description">
    </ext:GroupingSummaryColumn>
    <ext:ImageCommandColumn Width="40px" DataIndex="DocumentUrl" >
    <Commands>
    <ext:ImageCommand CommandName="OpenFile" Icon="ServerLink">
    <ToolTip Text="Open File" />
    </ext:ImageCommand>
    </Commands>

    </ext:ImageCommandColumn>

    </Columns>
    </ColumnModel>
    <View>
    <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" ShowGroupName="false"
    EnableNoGroups="true" HideGroupedColumn="true" />
    </View>
    <Plugins>
    <ext:GroupingSummary ID="GroupingSummary1" runat="server" />
    </Plugins>
    <SelectionModel>
    <ext:CellSelectionModel ID="cellSel" runat="server">
    <AjaxEvents>
    <CellSelect OnEvent="DwnloadImageItemClickAjax">
    <ExtraParams>
    <ext:Parameter Name="DownloadItem" Value="DownloadImg" />
    </ExtraParams>
    <EventMask ShowMask="true" />
    </CellSelect>
    </AjaxEvents>

    </ext:CellSelectionModel>
    </SelectionModel>
    </ext:GridPanel>


    ASPX.CS CodeBehind

    [AjaxMethod]
    protected void DwnloadImageItemClickAjax(object sender, AjaxEventArgs e)
    {

    cellSel.AjaxEvents.CellSelect.IsUpload = true;
    this.Context.Response.Clear();
    this.Context.Response.AddHeader("Content-Disposition", string.Format("attachment; filename=abc.xlsx"));
    this.Context.Response.ContentType = "application/octet-stream";
    this.Context.Response.WriteFile(string.Format("d:/p/abc.xlsx"));

    }

    I am getting this error:

    Request Failure
    Bad Response: Invalid Character
  2. #2
    Hello pooja

    Have managed to fix the issue ? i'm having the same issue as you:)

    Reg
    ISh

Similar Threads

  1. Replies: 2
    Last Post: Aug 30, 2013, 2:48 AM
  2. [CLOSED] BADRESPONSE downloading a file
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 24, 2012, 5:12 PM
  3. downloading PDF file
    By unaltro2 in forum 1.x Help
    Replies: 0
    Last Post: Mar 10, 2011, 6:37 PM
  4. [CLOSED] Save Dialog v0.8.1
    By cobiscorp in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 10, 2010, 10:29 AM
  5. Get the value from prompt dialog and save
    By CoolNoob in forum 1.x Help
    Replies: 5
    Last Post: Oct 23, 2009, 3:13 PM

Tags for this Thread

Posting Permissions