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

Eporting GridView with columns defined using Data Templates

4 Answers 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
esha aftab
Top achievements
Rank 1
esha aftab asked on 28 May 2010, 06:32 AM

I was trying to export the gridview to excel but its not working properly. My columns are defined as data templates. Is there any way to export such a grid containing such columns. Please help me in this issue.

--
Esha Aftab

4 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 28 May 2010, 08:54 AM
Hello esha aftab,

Are your templated columns of type GridViewColumn or GridViewDataColumn?

Best wishes,
Yavor Georgiev
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.
0
esha aftab
Top achievements
Rank 1
answered on 29 May 2010, 07:13 AM
I'm using GridViewDataColumn.
Something like this:
<Controls:GridViewDataColumn>
   <Controls:GridViewDataColumn.CellTemplate>
        <DataTemplate>
               <Grid>...
                          ...
               </Grid>
        </DataTemplate>
   </Controls:GridViewDataColumn.CellTemplate>
</Controls:GridViewDataColumn>


However now I'm writing my custom export so may be my issue will get resolved. Thank you for your prompt response.
0
????
Top achievements
Rank 1
answered on 24 Apr 2011, 12:30 PM
I've encountered with the same problem.
i'm using the latest version of the controls, also with GridViewDataColumn.
the columns in witch i use data template are not exported properly to Excel.
can u help me?

0
Vanya Pavlova
Telerik team
answered on 25 Apr 2011, 09:26 AM
Hi ????,




May you please elaborate a little bit more on your exact settings? 
Generally when you are using custom defined template it is better to handle the ElementExporting event and override the value for that column's cells to make the exported value look like your template, as demonstrated here.



Best wishes,
Vanya Pavlova 
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
esha aftab
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
esha aftab
Top achievements
Rank 1
????
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or