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

MVC grid iterate through all grid records with pagination

1 Answer 509 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vidya
Top achievements
Rank 1
Vidya asked on 08 Jul 2016, 07:28 PM

Hi,

I have a kendo mvc grid with page size 50 and have total records of 500. I want to iterate through all grid records and get the data view for all the 500 records in java script. I'm writing it as below in the grid export excel event and getting only the first 50 records in to the view . 

 var data = this.dataSource.view();

var template = kendo.template(this.columns[0].template);      

for (var i = 0; i < data.length; i++) {

var cellvalue =template (data[i]);

}

How do I get all the 500 records and iterate through them to get the view?

Thanks

Vidya

 

 

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 12 Jul 2016, 06:09 AM

Hello Vidya,

When you have paging enabled and ServerOperation(true), which is default configuration, both data() and view() DataSource methods will return only pageSize items.

If you disable server operations, i.e ServerOperation(false), data() method will contain all data items after initial binding as all data transformations (filter/paging/sorting etc.) will be performed client side.

Regards,
Nikolay Rusev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
Vidya
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or