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

Export to excel

1 Answer 121 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rudis
Top achievements
Rank 1
Rudis asked on 19 Aug 2010, 03:28 PM
Hello!

I want to export from a RadGridView to Csv format. The ToCsv() method work fine, the only problem is that I get to much information since I have objects in my columns. And what is displayed to the user is controlled by the DisplayMemberPath or a CellTemplate.

So the question is, how can I filter the export so it only takes the displayed values? Do I have to loop through all the rows and if so how do I fetch the displayed value?

Best regards/
Anna

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 20 Aug 2010, 03:37 PM
Hi Anna Rudlund,

I suggest you subscribe to the ElementExporting event of the grid and check the type of the exported element. You can cancel the event where you do not want to export the data of a given cell / object.

Here is the online article that should help: ElementExporting event.

Let me know if you face any problems.

Regards,
Veselin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Rudis
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or