Coder Social home page Coder Social logo

lanadx / asp-net-web-forms-grid-export-images Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devexpress-examples/asp-net-web-forms-grid-export-images

0.0 0.0 0.0 103.39 MB

Export images from a GridViewDataImageColumn column

License: Other

C# 69.44% ASP.NET 30.56%

asp-net-web-forms-grid-export-images's Introduction

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

[Run Online]

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

asp-net-web-forms-grid-export-images's People

Contributors

lanadx avatar devexpressexamplebot avatar onebalaban avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.