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 Image Column Export

Thread ID:





124770 Jun 29,2016 05:31 AM UTC Jul 8,2016 04:14 AM UTC WPF 5
Tags: SfDataGrid
Asked On June 29, 2016 05:31 AM UTC


How to Export the image data in the image column in SfDataGrid .

Attached is the sample shown SfDataGrid export to excel with data except image data.



Attachment: SfDataGridExport_155d0c52.zip

Elavarasan M [Syncfusion]
Replied On June 30, 2016 01:45 PM UTC

Hi Yap, 

Thank you for contacting Syncfusion support. 

We have analyzed your query and prepared the sample to export GridImageColumn into Excel as well as PDF.  
Please find the sample from below, 


Note: You have to set the UseBindingValue to the column as true when loading Image through converter and the underlying property of GridImageColumn is string. Otherwise you have to set the GridImageColumn underlying property as  BitMapImage instead of string.  

You can refer the below UG documentation to know more about the excel exporting, 

Also refer the below UG documentation to know more about the PDF exporting, 

You can also refer the below KB to know about the GridTemplateColumn PDF exporting, 

Elavarasan M

Replied On June 30, 2016 02:06 PM UTC

Hi Elavarasan,

Thanks for reply.

Attached is the excel file from exported. Its look a bit messy.

How to make the row height as shown in SfDataGrid for exported excel file.

Thanks Elavarasan.


Attachment: Excel_Row_Height_3351a832.zip

Elavarasan M [Syncfusion]
Replied On July 1, 2016 11:33 AM UTC

Hi Yap, 
Thanks for your reply. 
You can change the entire row height and the column width while exporting the SfDataGrid to excel like the below code example, 
var options = new ExcelExportingOptions(); 
ExcelEngine excelEngine = new ExcelEngine(); 
IWorkbook workBook = excelEngine.Excel.Workbooks.Create(); 
options.ExportMode = ExportMode.Text; 
this.dataGrid.ExportToExcel(dataGrid.View, options, workBook.Worksheets[0]);             
workBook.Worksheets[0].Range.RowHeight = 70; 
workBook.Worksheets[0].Range.ColumnWidth = 100; 
You can also set the particular row height and particular column width like the below code example, 
workBook.Worksheets[0].SetColumnWidth(1, 30); 
workBook.Worksheets[0].SetRowHeight(1, 30); 
We have modified the sample based on this and please find the sample from below, 
You can refer the below UG documentation to know about the row height and column width customization while exporting the SfDataGrid, 
Elavarasan M

Replied On July 7, 2016 02:08 PM UTC

Dear Elavarasan,

Thanks for reply.

Thank you.


Elavarasan M [Syncfusion]
Replied On July 8, 2016 04:14 AM UTC

Hi Yap,

Thank you for your update.

Please let us know if you require any other assistance.

Elavarasan M


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