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

RadGridView and Format Number text

7 Answers 54 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Leonard
Top achievements
Rank 1
Leonard asked on 25 Jan 2013, 02:02 PM
Good morning, 

I'm trying to export to excel and works perfect my implementation, but when exporting to excel a string like "009" shows "9" in Excel.

I need change a Number Format to Text.

This using GRIDVIEW and class control HtmlFormatProvider.

We need help please, thanks

7 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 30 Jan 2013, 01:32 PM
Hello,

In order to force Excel to treat a number as string you may insert an apostrophe at the beginning of the number
e.g. if you have the string 009 you may pass it to Excel as '009

This action may be performed in code within the RadGridView.ElementExporting event handler.

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Anderson
Top achievements
Rank 1
answered on 11 Apr 2017, 09:00 PM

Hi, I have this situation.

(see image001)

What do I have to do in the ElementExporting Event to get the field in the excel file as show in the grid.

Thanks

0
Dilyan Traykov
Telerik team
answered on 12 Apr 2017, 01:27 PM
Hello Anderson,

You can use the approach suggested in this article in order to achieve the desired result.

Please let me know if this works for you.

Regards,
Dilyan Traykov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Anderson
Top achievements
Rank 1
answered on 12 Apr 2017, 04:47 PM
Hi, in the article that you suggested to me it indicates that I can use a function called "ElementExportingToDocument". This function is not defined for the RadGridView, (please see the image "Pic1" and the image "Pic2") so I only have the function "ElementExporting" to modify the rows  (please see the image "Pic3") . Do you think I have the wrong version of Telerik? Thank you
Hi, in the article that you suggested to me it indicates that I can use a function called "Event". This function is not defined for the RadGridView, (please see the image "Image" and the image "Image2") so I only have the function "Function" to modify the rows. Do you think I have the wrong version of Telerik? Thank you
Hi, in the article that you suggested to me it indicates that I can use a function called "Event". This function is not defined for the RadGridView, (please see the image "Image" and the image "Image2") so I only have the function "Function" to modify the rows. Do you think I have the wrong version of Telerik? Thank you
0
Anderson
Top achievements
Rank 1
answered on 12 Apr 2017, 05:48 PM

Hi again. This article

http://docs.telerik.com/devtools/wpf/controls/radgridview/export/troubleshooting/export-string#export-string-value

indicates how to fix the issue I have, but its a little bit unconfortable to see =T(""field"")" when editing a cell. (See Pic1)

There is another way to fix it?

Thanks.

0
Dilyan Traykov
Telerik team
answered on 14 Apr 2017, 11:30 AM
Hello Anderson,

In order to modify the values by using the ElementExportingToDocument event, you will need to have version Q1 SP 2015 or newer and use the ExportToXlsx method.

If you really need to use the old Export method, the solution you've found is the only one we can offer.

Regards,
Dilyan Traykov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Anderson
Top achievements
Rank 1
answered on 17 Apr 2017, 02:43 PM
Hello, I appreciate your help and according to what you say I have no choice but to do it the way you suggest me. Thank you very much for your collaboration.
Blessings
Tags
GridView
Asked by
Leonard
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Anderson
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or