Infragistics WebExcelExporter设置要导出的最大行数

我使用infragistics WebDataGrid在ASP.NET应用程序中显示一些元素。 现在我使用WebExcelExporter类为所有分页行创build一个excel文件。 在WebExcelExporter中,我可以使用DataExportMode属性来设置要导出的元素的数量。 DataExportMode属性可以设置为DataExportMode.AllDataInDataSource和DataExportMode.DataInGridOnly。

现在的问题是,我只能显示当前页面或所有页面的结果。 由于性能,我想只导出4000行的最大数量。 有没有可能设置应该导出的最大行数?

通过devise,网格能够提供DataInGridOnly和AllDataInDataSource,是的。 虽然如果要限制导出的行,则始终可以使用GridRecordItemExporting来取消执行。

代码片段:

protected void excelExporter_GridRecordItemExporting(object sender, GridRecordItemExportingEventArgs e) { if (e.CurrentRowIndex > 4000) { e.Cancel = true; } }