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

[Solved] CSV export problem

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 18 May 2009, 09:27 AM
Hello all,
I have written a short web application with a RadGrid bind to sqlDataSource. The select command of the sqldatasource is generated dynamically as a response to a button click event and than the RadGrid is refreshed. There is another button to perform CSV export of the RadGrid. But whenever I click on it, I see that something is doing, but no dialog box to save the csv file appears. I can see that the IE8 do something, unfortunately I cannot read the bottom status bar of IE8

The exporting code is very simply:

 

    protected void ButtonCsvExport_Click(object sender, EventArgs e)

 

    {

        RadGridCommandList.MasterTableView.ExportToCSV();

    }

The RadGrid is populated. Multirow selection is turned on and others functions like "delete selected" or "update selected" work fine, the both are also triggered by buttons.

Please can someone help me, a newbie to Telerik ?

Thanks in adavance.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 May 2009, 02:47 PM
Hello Robert,

Can you try the following code and see whether it is working fine for you?

CS:
 
protected void Button1_Click(object sender, EventArgs e) 
    RadGridCommandList.ExportSettings.ExportOnlyData = true
    RadGridCommandList.ExportSettings.OpenInNewWindow true
    RadGridCommandList.MasterTableView.ExportToCSV(); 

Please examine the following links:
Export to Microsoft Excel/Word/PDF/CSV
Export from ajaxified grid

Thanks,
Shinu.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or