Here Mudassar Ahmed Khan has explained with an example, how to export WebGrid to CSV file with formatting in ASP.Net MVC Razor.
First the WebGrid will be populated from database using Entity Framework and when the Export Button is clicked, a Comma Separated (Delimited) string will be generated from WebGrid data and ultimately it will be exported to CSV file in ASP.Net MVC Razor.
↧