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

Grid data download via URL?

1 Answer 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 18 Mar 2015, 07:00 PM
I have a grid with an Export to CSV button.  Since we have users who call automatic "screen-scraping" programs, is there a way to do a csv download via a URL parameter or similar?  In other words, can I automatically start a csv download from the URL command?

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 23 Mar 2015, 10:23 AM
Hi Brad,

Thank you for contacting us.

Generally you can manually fire the export to CSV command from the server by simply calling ExportToCsv method. Nevertheless I would recommend to call the ExportToCsv method no earlier then PreRenderComplete event handler since there might be some issues.
protected void Page_PreRenderComplete(object sender, EventArgs e)
{
    ResultsGrid.MasterTableView.ExportToCSV();
}

Keep in mind that in this case the grid will not be render on the browser since the response is not send to the client.

I hope this information helps.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Brad
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or