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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfDataGrid Export to Excel issue

Thread ID:

Created:

Updated:

Platform:

Replies:

140942 Nov 15,2018 09:57 AM UTC Nov 21,2018 12:43 PM UTC WPF 1
loading
Tags: SfDataGrid
Vinay
Asked On November 16, 2018 10:30 AM UTC

Hello Team Syncfusion,

We are using Syncfusion in our company.We are using version 15.3460.0.29. I'm exporting SfDataGrid to excel by looking at solution given in 
https://www.syncfusion.com/kb/2471/how-to-export-groups-to-excel-and-also-export-group-outlining-from-sfdatagrid. 

1. But When I export I'm not getting any style such as header color,font color, font style applied as in above example. 
2. There is no formatting in exported excel like rows are aligned randomly. I need to Align middle for all rows. My need is it should look nice with good formatting.
2. Is it possible to make certain columns readonly or locked so that when its exported I shall allow only specific columns to be edited. ?
3.In exported excel, how to freeze Header column while scrollling down through code?
4. Referring to some sample present in SF Knowedge Base, I tried importing data from updated excel(with some changes in some columns) to SfDatagrid. I'm able to load data to SfDatagrid. However when I import excel with grouping done programatically in SFDatagrid, some rows are shown empty. How can I import with grouping toSFDatagrid.

Thanks and regards,
Vinay

Deivaselvan Y [Syncfusion]
Replied On November 21, 2018 12:43 PM UTC

Hi Vinay,

We have prepared a sample to meet all your requirement. Refer the sample from the below link and let us know if this helps you.

http://www.syncfusion.com/downloads/support/directtrac/220817/ze/SfDataGridDemo_20121541558818.zip

You could follow the below steps to run the attached sample. 
1.       Run the sample application 
2.       Click on "Export To Excel" button - To export the DataGrid to Excel 
3.       Following files will be generated in the output folder 
a.       ExportToExcel.xlsx - Will be reused for importing 
b.       DataGrid.xml - Data Operations of the DataGrid Serialized file and will be reused during importing to retain the grouping again in the DataGrid 
c.       ExportToExcel.xlsm - Will be the resultant Exported excel file which allows the user to expand and collapse the group for the protected sheet while click on the "Enable Content" while opening this file in MS Excel 
4.       Click on the "Clear DataGrid" button to set ItemsSource as null 
5.       Click on the "Import From Excel" button to import the data from the exported excel    sheet with grouping 

Note: To execute the exporting action you should enable the below option in MS Excel From File --> Options. 



Please let us know if you have any other questions.

Regards,
Deivaselvan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;