I am trying to implement a DataGrid with Custom Remote Paging.
I can not pass the value of the RecordCountKey, or I do not Know how to do it. This is part of my code:
On the Controller:
[GridDataSourceAction] [HttpGet] public ActionResult SearchTransferences(int SizePage, int NumberPage) {
DataTable dtable = ... here I do my stuff
return View("Index", dtable);
}
On my view i have;
@(Html.Infragistics() .Grid<DataTable>() .ID("Grid")
...
feature.Paging().PageSize(10).Type(OpType.Remote) .RecordCountKey("Data.TotalRows")
Hello Jose,
Thank you for posting in our forum.
When using the [GridDataSourceAction] attribute the remote operations will be handled out of the box.
In the response json the data records will be wrapped in a Records object and the total record count will be set in a TotalRecordsCount object.
Example json response from an action that has the [GridDataSourceAction] attribute applied to it:
{"Records":[{ … }], TotalRecordsCount: 20}
Those are also the default values set for the grid’s ResponseDataKey and the RecordCountKey when initializing the grid via the MVC wrappers.
So you should either not set those options in order for them to take their default values or you should set them to “Records” and “TotalRecordsCount” in order to match their respective response json objects.
I’ve attached a sample with a grid bound to a data table and remote paging for your reference.
Please refer to it and let me know if you have any questions.
Best Regards,
Maya Kirova
Infragistics, Inc.
http://www.infragistics.com/support
Hi Maya, thanks for the response,
I need to use custom remote paging because a need paging from database. In the example you provided me yo are not using custom paging. You are sending all the data to the grid.
COuld you please send me an example with custom remote paging?
I'm attaching a sample demonstrating how to implement custom Paging when binding igGrid to DataTable.
Best regards,Martin PavlovInfragistics, Inc.