Skip to content

DevExpress-Examples/mvc-gridview-export-data-to-different-formats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid View for ASP.NET MVC - How to export grid data to different formats

This example illustrates how to use the ExportTo* methods to export the GridView 's content in different formats.

GridView export

Note the following key points when you export GridView extension content:

  • Define the GridView extension in a separate PartialView (TypedListDataBindingPartial.cshtml) without any additional tags.
  • Wrap the GridView's PartialView in a form to apply the client's layout state (sorting, filtering, etc.).
    @using(Html.BeginForm("ExportTo", "Home")) {
        // ...
        @Html.Partial("TypedListDataBindingPartial", Model)
    }
    
  • Make a POST request to submit this form to the corresponding Controller Action.
  • The GridViewSettings (especially the Name property) should be the same in PartialView and Controller;
  • The data source/Model should be the same in PartialView and Controller.

Files to Review

Does this example address your development requirements/objectives?

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

About

Use the ExportTo* methods to export the GridView 's content in different formats.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •