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

Exporting to CSV/XLS within Silverlight Application

6 Answers 171 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michele
Top achievements
Rank 2
Michele asked on 01 Jul 2009, 09:02 AM
Hello to everybody,
I need to export the RadGridView to XLS/CSV and I've followed the demo,
the demo has the button in a web application and it works since it takes the string and prepare the HttpResponse setting the headers,

In my case I've got the hierarchy structured as :

ASP.NET Web Application -> Silverlight Application [Menu + Content that contains usercontrols] [Gridview].

I can't have the button in the web application since the button should be outside the usercontrol that contains the gridview.. any suggestion?

Thanks in advance

Paolo

6 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 01 Jul 2009, 09:06 AM
Hi Paolo,

Please check this demo instead:
http://demos.telerik.com/silverlight/#GridView/Exporting

Other possible approach is to use SaveFileDialog in Silverlight 3 directly.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Michele
Top achievements
Rank 2
answered on 01 Jul 2009, 09:42 AM
Hello Vlad,
thanks for your answer, I've tried the demo and I was able to save the file on the server, btw I still need to create the response to send it to the client, am I right?

Thanks

Paolo
0
Vlad
Telerik team
answered on 01 Jul 2009, 11:13 AM
Hello Paolo,

Indeed in Silverlight 2 this is the only way however in Silverlight 3 you can show directly save file dialog and save the file on the customer PC.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Michele
Top achievements
Rank 2
answered on 01 Jul 2009, 12:27 PM
Thanks a lot,
it worked... just a last question, it's possible to export an hidden column or it won't be saved? I've the ID that's 10char long and it won't be usefull to be shown in the grid but needed in the excel/csv

Thanks

Paolo
0
Vlad
Telerik team
answered on 01 Jul 2009, 12:54 PM
Hi Paolo,

You can easily do:

            RadGridView1.Columns["ID"].IsVisible = true;

            string csv = RadGridView1.ToCsv();

            RadGridView1.Columns["ID"].IsVisible = false;

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Veda
Top achievements
Rank 1
answered on 12 Jul 2011, 07:51 AM
Hi,
I want to export labels, textbox data, chart and radgridviews which are placed in radtabcontrol. Attching the screen shot of the UI.

On click of export button i should be able to export the entire data in similar format into csv file.

Also need to print the same.

Regards,
Veda
Tags
GridView
Asked by
Michele
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Michele
Top achievements
Rank 2
Veda
Top achievements
Rank 1
Share this question
or