This is a migrated thread and some comments may be shown as answers.

Items per page not refreshed after datasource changed

1 Answer 164 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Iuliana Maria
Top achievements
Rank 1
Iron
Iuliana Maria asked on 15 Mar 2018, 02:29 PM

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?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 16 Mar 2018, 11:48 AM
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.
Tags
Grid
Asked by
Iuliana Maria
Top achievements
Rank 1
Iron
Answers by
Viktor Tachev
Telerik team
Share this question
or