Hello
Converted igGrid from Asp .net MVC to Asp .net Core.
Earlier there used to be a TotalRecordsCount member in the GridPaging feature.
Mentioned here https://ko.infragistics.com/community/forums/f/ignite-ui-for-jquery/74927/server-side-paging/379131#379131
Now this member is not found
How to specify TotalRecordsCount in the initial load of the grid with gridpaging enabled.
Need asap
Thanks
Hello Abhishek,
The totalRecordsCount of the dataSource could be set as follows:
function dataBinding(evt, ui) {
if (ui.owner.options.dataSource.settings) {
ui.owner.options.dataSource.settings.dataSource.TotalRecordsCount = 20;
}
As stated above please keep in mind that by setting the totalRecordsCount, new pages are created and displayed in order to match the number set through the property, however, the additional pages are empty.
Please test it on your side and let me know if you need any further information regarding this matter.
Regards, Monika Kirkova, Infragistics
Option 2 "totalRecordsCount of the dataSource could be set in the client side" --> Pl provide example.
Feature request for option 1 added here
github.com/.../2189
The conversion of the dataset to model is achieved internally and could not be modified and responseDataKey could not be set in the controller. As stated in my previous response the totalRecordsCount of the dataSource could be set in the client side, however, loading the data should be handled manually when the Page Index is changed.
What I can suggest is creating a feature request regarding exposing totalRecordCount property of the Paging feature in our GitHub repository here if you want to see it implemented in any of our future releases. This will give you the opportunity to communicate directly with our developers and get notifications when new information regarding your query is available.
When creating the request please be sure to be specific and provide as much details as possible. Attaching a working sample, screenshots and any information that consider relevant are going to be very helpful.
Please let me know if you need more information.
Hi Monika
Actually conversion to model is not possible, because the dataset fields are not known ahead of time.
As per my understanding, igGrid converts dataset to list(of object) models internally.
So is it possible to convert dataset to a model with list(of object) and the TotalRecordsCount field?
Note that dataset may have multiple tables in our case (we are usingigHierarchicalGrid)
Your requirement could be achieved in two different ways.
The first option is to convert the DataTable from the DataSet to a Model(defined in the Products.cs file) and pass a Json to the View, containing the Model and the TotalRecordsCount. This should be done, in order for the Grid to bind correctly to the data and for the Paging to be able to access TotalRecordsCount field and to set it as responseDataKey.
Another possibility is to use the totalRecordsCount method of the dataSource in a method bound to the databinding event of the Grid. By setting the totalRecordsCount, new pages are created and displayed in order to match the number set through the method, however, the additional pages are empty.
Below I am attaching a sample demonstrating the first approach. Please test it on your side and let me know if you need any further information regarding this matter.
5531.igGridTotalRecordsCount.zip