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

export to excel

3 Answers 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mahdi
Top achievements
Rank 1
Mahdi asked on 17 Aug 2016, 12:10 PM

hello .I have a question about exporting a grid to excel

I have a grid with one numeric column(INT 32) and I want to show the content of this cell with comma (Like 10,000) and when it will export to excel it shows exactly like the content (I mean 10,000 in grid and in excel both) And the main part is I want it will be numeric cell in excel not string cell.

I have added this parts to column  :   DataType="System.Int32" DataFormatString="{0:n0}

but after exporting, this cell format is not numeric .it is string and I should change it to numeric cell manualy . I want it in numeric format .

Thanks in Advanced

3 Answers, 1 is accepted

Sort by
0
Doug
Top achievements
Rank 1
answered on 17 Aug 2016, 01:10 PM
maybe try as an sample test to put a number in the header row for that column. with the first row sometimes excel will determine its format type.
0
Mahdi
Top achievements
Rank 1
answered on 20 Aug 2016, 09:33 AM

Hello Mr Doug

Unfortunately it didn't work and My Problem still Exist. but I'm sure there is a Trick to solve This Problem

Is There any  Other Solution(S)?

Please help me

 

 

 

 

0
Viktor Tachev
Telerik team
answered on 22 Aug 2016, 08:24 AM
Hi,

In order for the values in the cells to be formatted correctly you need to ensure that the cell is formatted as number. Check out the following sample that illustrates how you can format the cells in the exported Excel file:



Regards,
Viktor Tachev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Mahdi
Top achievements
Rank 1
Answers by
Doug
Top achievements
Rank 1
Mahdi
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or