Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
GRID EXCEL EXPORT NOT EXPORTING WHOLE GRID DATA TO EXCEL - Remote Paging (v16.2)
posted

Hi Friends,

We are using infragistics 16.2 version and we have used the REMOTE paging and filtering option in the GRID. as we have tried to export the whole grid data, application not exporting the whole grid data to excel file instead only the first page data is exporting to the excel file.

Please help us to proceed further. please find the below code sample,

Binding the data into GRID

function BindGrid(gridId, columns, gridData, noSortingColumn, noFilterColumn, isPermission) {

var pageCount = indexGridPageCount();

var gridHeight = indexGridHeight();

$("#" + gridId).igGrid({

primaryKey: "FeatureId",

autoGeneratecolumns: false,

width: "100%",

height: "" + gridHeight + "",

columns: columns,

fixedHeaders: true,

autofitLastColumn: false,

responseDataKey: "Records",

features: [

{

name: "Selection",

mode: "row",

activation: true,

},

{

name: "Responsive",

enableVerticalRendering: false,

enableCheckBoxes: true

},

{

name: "Paging",

type: "remote",

pageSize: "" + pageCount + "",

pageCountLimit: 100,

visiblePageCount: 5,

pageSizeList: [10, 20, 50, 100],

recordCountKey: "TotalRecordsCount"

},

{

name: "Filtering",

type: "remote",

columnSettings: noFilterColumn,

filterDropDownItemIcons: true,

filterDropDownWidth: 0,

filterExprUrlKey: "filter"

},

{

name: "Sorting",

type: "remote",

columnSettings: noSortingColumn,

sortUrlKey: 'sort',

sortUrlKeyAscValue: 'asc',

sortUrlKeyDescValue: 'desc'

},

{ name: 'Tooltips', visibility: 'overflow' },

{

name: 'Updating',

enableAddRow: false,

enableDeleteRow: isPermission,

editMode: 'none',

rowDeleting: function (e, args) {

featureId = args.rowID;

featureCode = args.element[0].cells[1].innerHTML;

if (featureCode != null) {

var messageDelete = "Are you sure you want to delete " + featureCode + "?";

$('#lblMessage').html(messageDelete);

}

$('#dialogDelete').dialog('open');

return false;

}

},

],

enableHoverStyles: true,

dataSource: "@(Url.Action("FeatureGridData"))",

});

}

Excel Export Button click

$("#btnExcelExport").on("click", function () {

Var url = '@Url.Content("~/Feature/GridView")';

var gridData = BindData(url, 'json', null, false);

var gridLength = $('#gridFeatures').igGrid('rows').length;

if (gridLength == "0") {

$('#dialogExport').dialog('open');

}

else {

ExcelExport("gridFeatures", "Feature");

}

});

Excel export function in JS

function ExcelExport(gridID, excelName, loaderID) {

$.ig.GridExcelExporter.exportGrid($("#" + gridID), {

fileName: excelName,

worksheetName: 'Sheet1',

dataExportMode: "allRows",

gridFeatureOptions: {

paging: "allRows",

sorting: "applied",

summaries: "applied",

filtering: "applied",

columnFixing: "applied",

hiding: "visibleColumnsOnly",

//columnsToSkip: [{ key: "StudyId" }],

},

},

{

error: function (err) {

alert(err.statusText);

}

});

}