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

How set the ExportOption for visible into grid?

Thread ID:

Created:

Updated:

Platform:

Replies:

104262 Jul 4,2012 12:47 PM UTC Aug 24,2012 04:02 AM UTC ASP.NET MVC (Classic) 2
loading
Tags: Grid
Jawed
Asked On July 4, 2012 12:47 PM UTC

Hi Want excel export but only visible columns. So How to set ExportOption in grid?

Thanks
Jawed



he wei
Replied On July 7, 2012 08:01 PM UTC

I got the similar problem, how to format export data (let's say Excel export)?

thanks,
WH

Rakesh D [Syncfusion]
Replied On August 24, 2012 04:02 AM UTC

Hi  Jawed, he wei;

 

Thank you for your interest in Syncfusion products.

 

To achieve excel export for only visible columns, configure the grid toolbar to enable exporting grid records and Specify the file name, Excel version,ConverterOptionsExt details in the ExportToExcel() method. Please refer to the following code snippet for details.

 

View[cshtml] 

@{ Html.Syncfusion().Grid<Order>("OrdersGrid")

        .ToolBar(tools => tools.Export(GridToolBarItems.ExcelExport, "Export",           "ExportToExcel"))

.Render();

        

Controller

public ActionResult ExportToExcel()

        {

            var data = new NorthwindDataContext().Orders.Take(200).ToList();

            return data.GridExportToExcel<Order>("GridExcel.xlsx", ExcelVersion.Excel2007, ConverterOptionsExt.Visible);  //ConverterOptionExt.Visible exports only visible rows

      }

 

Please let us know if you need further assistance.


Regards,
Rakesh D



CONFIRMATION

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.

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

;