Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143009 | Feb 28,2019 12:31 PM UTC | Mar 5,2019 05:39 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: Grid |
@Html.EJS().Grid("Grid")...EnableColumnVirtualization().EnableVirtualization().Height("500").AllowExcelExport(true)
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").Add();
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add();
col.Field("EmployeeID").HeaderText("Customer Name").Width("150").Add();
...
}).Load("load").ExcelExportComplete("excelExportComplete").ToolbarClick("toolbarClick").Toolbar(new List<string>() { "ExcelExport" }).Render()
<script>
function toolbarClick(args) {
var gridObj = document.getElementById("Grid").ej2_instances[0];
if (args.item.id === 'Grid_excelexport') {
//Disable virtualization before calling excel export method
gridObj.enableColumnVirtualization = false;
gridObj.enableVirtualization = false;
gridObj.excelExport();
}
}
function excelExportComplete(args) {
//Enable the virtualization here
this.enableColumnVirtualization = true;
this.enableVirtualization = true;
}
...
</script>
|
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.
This page will automatically be redirected to the sign-in page in 10 seconds.