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

Export to excel - format data as string

1 Answer 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andreas Ladis
Top achievements
Rank 1
Andreas Ladis asked on 21 Dec 2011, 05:28 PM
Hello everyone,
I use the Version=2010.1.415.35 of Telerik controls.

I want to export the data from a Grid to an excel but when the column data are like "00455500400400", I get wrong data in the excel, or I get the data as numbers.(see attached picture)
I found the e.Cell.Style("mso-number-format") = "\@" formatting approach, but I can use it only in the 2011 version.
I cannot add spaces, or text on the exported data. I want the original data to be formatted as text.

Could you please help me how to implement this? Below I attach the column definition:

<telerik:GridBoundColumn DataField="Κωδικός Προϊόντος" 
HeaderText="Κωδικός Προϊόντος"
DataFormatString="{0}"
DataType="System.String"
SortExpression="Κωδικός Προϊόντος"
UniqueName="Κωδικός Προϊόντος">
<HeaderStyle Width="155px"></HeaderStyle>
</telerik:GridBoundColumn>

Thank you in advance!
 Andreas

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Dec 2011, 05:13 AM
Hello Andreas,

You can achieve this by using mso-number format. Try upgrading to the latest version.
Updating RadControls for ASP.NET AJAX to another version or license

-Shinu.
Tags
Grid
Asked by
Andreas Ladis
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or