We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dynamically change grid pageSize

I have a grid that I would like to allow the user to select the page size used by the pager.

var gridObj = $("#grid").ejGrid("instance");
gridObj.option({ "pageSettings": { "pageSize": args } });
This code works for the first page. But, when I use the try to go to page 2 it displays all of the records in the model. Is this a known bug? Is there a work around?
This is my DataManager:
var dm = ej.DataManager({
                   url: "FetchData",
                   adaptor: new ej.UrlAdaptor(),
                   offline: true
               });

7 Replies

SR Sellappandi Ramu Syncfusion Team December 7, 2015 12:25 PM UTC

Hi Toi,

Thanks for contacting Syncfusion support.

While using offline property as true in datamanager, the server side request only once and further data manipulation operation can be done at client-side itself. So all the data will  be in data source model.

Please refer to the online help documentation for offline property,

http://help.syncfusion.com/aspnetmvc/datamanager/data-binding#offline-mode

Url Adaptor of the DataManager can be used when you are required to use remote service to retrieve data wen perform the paging operation or CRUD operation in grid.

Please refer to the online help documentation for URL adaptor,

http://help.syncfusion.com/aspnetmvc/datamanager/data-adaptors#url-adaptor

We suggest you to remove the offline property from datamanager to perform paging operation in server request.

Please refer to the below Knowledge Base document for server side operation, 

https://www.syncfusion.com/kb/4300/server-side-api-for-datamanager-operations

Regards,
Sellappandi R


CM Chris Marinacci October 25, 2017 05:13 PM UTC

I just ran into this exact same problem, without explicitly using a DataManager. I change the page size from 10 to 25 on the first page and the code works, but when I go to the second page many more than 25 records are displayed.

The issue is that the page size is set to a particular value, but the grid doesn't reflect that value when it displays data. It's a bug in the way that the grid displays data after the page size is changed.



TS Thavasianand Sankaranarayanan Syncfusion Team October 26, 2017 04:05 PM UTC

Hi Chris, 
 
Thanks for contacting Syncfusion support. 
 
We have analyzed your query and we are unable to reproduce the reported issue ”Changing the page size and move to next page returns all records in Grid” from our end. 
 
We have prepared a sample and it can be downloadable from the below location. 
 
 
Refer the below screen shot that after we move to the next page only 25 records get bound to the Grid. 
 
 
 
Please provide the following details for better assistance. 
 
  1. Share screen shot or video demonstration of the issue.
  2. Share the exact scenario or proper replication procedure to reproduce the issue.
  3. Share the full Grid code example both server and client side.
  4. Essential Studio version details.
  5. If possible share the sample or reproduce the issue in the attached sample.
 
Regards, 
Thavasianand S. 



CM Chris Marinacci October 26, 2017 06:07 PM UTC

Hi Thavasianand,

The sample code that you sent doesn't compile. It has hardcoded references to three Syncfusion DLLs that don't exist in the ZIP file, and a reference to System.Data.SqlServerCe that cannot be resolved. Can you create a sample that uses all NuGet packages?
Thanks,
Chris


TS Thavasianand Sankaranarayanan Syncfusion Team October 27, 2017 03:40 PM UTC

Hi Chris, 
 
We have modified the sample and it can be downloadable from the below location. 
 
 
Regards, 
Thavasianand S. 



CM Chris Marinacci October 27, 2017 04:33 PM UTC

Hi Thavasianand,

I had to update the database to a more recent version.

There's still an unresolved reference to System.Data.SqlServerCe, which I resolved by installing a NuGet package (System.Data.SqlServerCe_unofficial).

However, when I run the program (both before and after installing this package) I get an exception:

Server Error in '/' Application.


Specified argument was out of the range of valid values.
Parameter name: site


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +280

[HttpException (0x80004005): Specified argument was out of the range of valid values.
Parameter name: site]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10042604
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Thanks,

Chris




TS Thavasianand Sankaranarayanan Syncfusion Team October 30, 2017 03:33 PM UTC

Hi Toi, 

We have prepared a video demonstration that we are unable to reproduce the reported issue. 


Please provide the following details for better assistance. 

  1. Share screen shot or video demonstration of the issue.
  2. Exact scenario or proper replication procedure.
  3. Essential studio version details.

Regards, 
Thavasianand S. 


Loader.
Up arrow icon