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

Grid view Export to Excel

1 Answer 16 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Baskar
Top achievements
Rank 1
Baskar asked on 02 Dec 2011, 10:01 AM
Hi

am using to Gridview to export in Excel,

here am i have Employee DTO--> EmpNo, Ename, Dno.

and i have Dept DTO--> Dno, Dname , Location,

Here i have create class  EmployeeListDTO which has all string poroperty, (i.e)

public class EmployeeListDTO
{
   Public string EmpName {get; set;}
   public string DeptName { get; set;}
  public string  Location { get; set;}
}

i got list of collection from above two class,

Create a new collection ObservableColection<EmployeeList> myList=new ObservableColection<EmployeeList>();

Now in the myList i have assign the above list, now i set to the datagrid, its working fine

the grid is display like this

EmpName DepName Location
AAA            XXX           USA
BBB            YYY          Europe
CCC            XXX          Canada

Now am trying to Export this grid to Excel, it is exporting sucessfully, but when i check the excel sheet, it was displaying like this

EmpName     DepName                             Location
AAA            EmployeeListDTO            EmployeeListDTO
BBB            EmployeeListDTO            EmployeeListDTO
CCC           EmployeeListDTO            EmployeeListDTO

Can any one tell me what is reason, why it was display the object instead of values.





1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 02 Dec 2011, 05:56 PM
Hi Baskar,

 Could you please provide some additional information for the column that is exported wrong? How do you bind the "DepartmentName"? Do you use some DataTemplate for the content of this column?

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Baskar
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or