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