We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Exporting To Excel from Grid data bound control

Hi,
Please find attached images for "Exporting To Excel from Grid data bound control".
I am using the following syncfusion method to export.
"sheet.ImportDataView(dtExport.DefaultView, true, 4,1, maxRows, -1, false);"
Please look at the comments column (String column) in the image, I am having this (05/08 2 5/8) value on comments column first row and my data table also contains the same value, but when I do export, it is coming like (05/08/2007) instead of (05/08 2 5/8).
Kindly give me the solution at the earliest.

Regards,
Anna



Images20.zip

1 Reply

MW Melba Winshia Syncfusion Team January 25, 2007 12:26 PM UTC

Hi Anna,

Could you please set "true" to the preserveTypes property of ImportDataView method so that the data type is also preserved along with it during importing into excel? Please refer the following code snippet that illustrates the above:

[C#]
//Import data to excel
sheet.ImportDataView(dataview,true,1,1,-1,-1,true);

Please refer the following sample which implements the above said feature:

GridToExcel.zip

Please take a look at the attached sample and let me know if you have any other queries.

Best Regards,
Melba


Loader.
Live Chat Icon For mobile
Up arrow icon