Items per page not refreshed after datasource changed

2 posts, 0 answers
  1. Iuliana Maria
    Iuliana Maria avatar
    16 posts
    Member since:
    Mar 2015

    Posted 15 Mar 2018 Link to this post

    Hello,

     

    In our grid, we read data dynamically based on an action in C#.

    Recently, we noticed that, if first we retrieve less rows and than more, the "Items per page" is not refreshed and less data is displayed:

    Example:

    1) We read data that returns 2 rows. Items per page is 2, correct.

    2) We read data that return 6 rows. Items per page is still 2, and only two items are displayed in grid

    3) Changing pagesize manually will display the correct number (chosen value or all values if less than chosen value).

    It used to work correct before. What can be the cause of the problem, and which is the solution?

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2480 posts

    Posted 16 Mar 2018 Link to this post

    Hello Iuliana,

    By default the pager will use the pageSize specified in the DataSource configuration. If the Grid is configured as autoBind=false and the total number of items is less than the page size the pager will show the total as page size when the data is retrieved. 

    If you would like to change that behavior you can use dataSource.fetch() instead of read().

    In case the behavior persists please send us a runnable sample where the behavior is replicated so we can examine it locally. 

    Regards,
    Viktor Tachev
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top