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

Export: Wrong data type on export.

1 Answer 31 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jared
Top achievements
Rank 1
Jared asked on 20 May 2011, 03:31 AM
I'm using DataFormatString to format an integer and noticed the column is exported as a String. This value needs to remain as an integer\number so that users are able to work with it in Excel.

What is the best way to format a column yet maintain it's original type when exporting to excel (ExportFormat.ExcelML)?

XAML
<grid:GridViewDataColumn Header="Example Count" 
			 DataMemberBinding="{Binding ExampleCount}" 
		         DataFormatString="{0:N0}">

ExampleExport.xml
<Cell  ss:Index="2"><Data ss:Type="String">9281</Data></Cell>

Note: I noticed the same behaviour when using an IValueConverter to format the integer rather than DataFormatString.

Thanks for your help!

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 May 2011, 06:57 AM
Hi,

 Indeed any type after string.Format() will be string. Formating types is just converting the data to string with desired format. 

Greetings,
Vlad
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
Jared
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or