Skip to content

DevExpress-Examples/asp-net-web-forms-grid-export-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid View for ASP.NET Web Forms - How to export images from the column of the GridViewDataImageColumn type

The ASPxGridView control exports images contained in a column of the GridViewDataBinaryImageColumn type.

If your grid displays images in a column of the GridViewDataImageColumn type, handle the ExportRenderBrick event and assign the image to the ImageValue property.

protected void Grid_ExportRenderBrick(object sender, ASPxGridViewExportRenderingEventArgs e) {
    var dataColumn = e.Column as GridViewDataColumn;
    if(dataColumn != null && dataColumn.FieldName == "ImagePath" && e.RowType == GridViewRowType.Data)
        e.ImageValue = GetImageBinaryData(e.Value.ToString());
}

Note that the ExportRenderBrick event does not fire in DataAware export mode, so you should set the export mode to WYSIWIG.

protected void btnXlsExport_Click(object sender, EventArgs e) {
    Grid.ExportXlsToResponse(new XlsExportOptionsEx() { ExportType = ExportType.WYSIWYG });
}
protected void btnXlsxExport_Click(object sender, EventArgs e) {
    Grid.ExportXlsxToResponse(new XlsxExportOptionsEx() { ExportType = ExportType.WYSIWYG });
}

Files to Review

Documentation

Technical Demos

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Export images from a GridViewDataImageColumn column

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •