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

Grid export: No download file popup

2 Answers 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Damien
Top achievements
Rank 1
Damien asked on 21 Dec 2012, 02:47 PM
Hello,

I want to make a csv export of my RadGrid (see below). My grid is in a RadAjaxPanel with RadAjaxLoadingPanel.
I first tried with the export button in the command area of the grid, but when I clicked on the button, I saw the loading panel but no popup appeared to make me choose the filename.

I tried  with a personal export button to be sure to call the export function in the code behind (see below), but I have the same behaviour: no popup.

Someone could say me what I forgot ?

Thanks by advance
Regards
Damien


<telerik:RadGrid ID="RadGrid1" runat="server"
                                                    AllowSorting="true"
                                                    ShowGroupPanel="true"
                                                     
                                                    GridLines="Both"
                                                  
                                                    ItemStyle-CssClass="RowStyle"
                                                    AlternatingItemStyle-CssClass="AlternatingRowStyle"
                                                    HeaderStyle-CssClass="HeaderStyle"
                                                    SelectedItemStyle-CssClass="SelectedRowStyle"
 
                                                    ClientSettings-Selecting-AllowRowSelect="true"
                                                    ClientSettings-Resizing-AllowColumnResize="true"
                                                    ClientSettings-Resizing-AllowRowResize="true"
                                                    ClientSettings-Scrolling-AllowScroll="true"
                                                    ClientSettings-Scrolling-UseStaticHeaders="true"
                                                    ClientSettings-Scrolling-FrozenColumnsCount="1"
                                                    ClientSettings-Scrolling-SaveScrollPosition="true"
                                                    ClientSettings-AllowColumnsReorder="true"
                                                    MasterTableView-AllowMultiColumnSorting="true"
                                                    ClientSettings-ClientEvents-OnGridCreated="GridCreated"
                                                    SortingSettings-SortedBackColor="Beige"
                                                    SortingSettings-EnableSkinSortStyles="false"
                                                    SortingSettings-SortToolTip="tri">
 
                                        <ClientSettings AllowDragToGroup="true" />
                                        <GroupingSettings ShowUnGroupButton="true" />
                                        <ExportSettings IgnorePaging="true" >
                                            <Csv ColumnDelimiter="Semicolon" EncloseDataWithQuotes="true" />
                                        </ExportSettings>
 
                                    </telerik:RadGrid>
                                  
 
                                    <asp:Button ID="btnExportCVS" runat="server" Text="Export" CssClass="CTAButton" Enabled="true" OnClick="btnExportCVS_OnClick"></asp:Button>

protected void btnExportCVS_OnClick(object sender, EventArgs e)
{
    this.RadGrid1.MasterTableView.ExportToCSV();
}

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Dec 2012, 07:33 AM
Hi,

If you have ajaxified the grid, make sure that ajax is disabled before exporting. Try the following javascript to disable ajax.
JS:
function onRequestStart(sender, args) {
  if (args.get_eventTarget().indexOf("btnExportCVS") >= 0)
    args.set_enableAjax(false);
}

Thanks,
Shinu.
0
Damien
Top achievements
Rank 1
answered on 04 Jan 2013, 02:17 PM
Hello,

Thank you Shinu for your response. I made as you suggested and I now have my popup.

Regards,

Damien
Tags
Grid
Asked by
Damien
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Damien
Top achievements
Rank 1
Share this question
or