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.
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 excelsheet 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.