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

Grid.Pageable(false) but Grid still show DataSource.PageSize(m) records only

3 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Veteran
Iron
Chris asked on 23 Nov 2017, 03:56 AM

HI

I found there have a problem about Grid.Pageable() and DataSource.PageSize().

If you set Grid.Pageable(false) and Grid becomes unpageable(this is OK)
but DataSource.PageSize(m) setting still applied (Grid still show m records at once, not all records).

I think when Grid.Pageable(false) and Grid should show all records absolutely, RIGHT ? 

  @(Html.Kendo().Grid(Model.MyList1)
    .Name("MyList1Grid")
    .Pageable(pageable => pageable.Enabled(false))
    ...
    .DataSource(dataSource => 
    {
      dataSource.Ajax()
        .PageSize(3)
        .ServerOperation(false)
        .Model(model => model.Id(m => m.UniqueID))
    })
    ...;

*Telerik DevCraft UI for ASP.NET MVC R2 2017 SP1

Best regards

Chris

 

 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 24 Nov 2017, 11:04 AM
Hello, Chris,

The described result is expected because the DataSource is working on the data level only. The pageSize set in the dataSource will determine the number of items in its view, and the pageable property of the Grid will determine if there will be a visible UI rendered to control the pages.

The main reason is that the Grid has a virtual scrolling and endless scrolling features which depend on the pageSize of the dataSource and at the same time does not use the Pageable property of the Grid:

https://docs.telerik.com/kendo-ui/controls/data-management/grid/appearance#virtual-scrolling

https://docs.telerik.com/kendo-ui/controls/data-management/grid/appearance#endless-scrolling

Please let me know if you need additional information on this matter.

Regards,
Stefan
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.
0
Chris
Top achievements
Rank 1
Veteran
Iron
answered on 28 Nov 2017, 09:04 AM

OK, I will remove the dataSource.PageSize(m) setting.

And I think the API Document should describe this situation clearly : 

pageSize
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-pageSize

Best regards

Chris

 

 

0
Stefan
Telerik team
answered on 29 Nov 2017, 12:34 PM
Hello, Chris,

Thank you for the provided feedback, it is highly appreciated.

We will discuss if we can make the description more accurate as we constantly try to improve our documentation.

Currently, this is not added as the DataSource is an independent component and may be used with widgets other than the Grid.

We will consider adding it in the Grid pageable description.

Regards,
Stefan
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
Chris
Top achievements
Rank 1
Veteran
Iron
Answers by
Stefan
Telerik team
Chris
Top achievements
Rank 1
Veteran
Iron
Share this question
or