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

SfDataGrid Export to Excel issue

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 

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,

1 Reply

DY Deivaselvan Y Syncfusion Team 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.


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.


Live Chat Icon For mobile
Up arrow icon