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

Copy data to another grid problem with virtual scrolling on

1 Answer 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 30 Nov 2015, 10:14 PM

Hi,

The below code works to copy data from one grid to another.
However, it looks like only copies the selected page when virtual scroll is on.

Is there a way to copy the entire datasource from one grid to another when virtual scroll is on?

 

var sourcegrid = $('#grid').data('kendoGrid');        //SOURCE GRID
var destinationgrid = $('#printableGrid').data('kendoGrid'); // DESTINATION GRID
destinationgrid.setDataSource(sourcegrid.dataSource);
destinationgrid.refresh();
$("#printableGrid").show();

Thanks,

 

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 03 Dec 2015, 08:25 AM
Hello Ryan,

Virtual scrolling is usually used when the Grid has to display large amount of records. Copying all of them would be a huge hit to the performance of the application.

Anyway, in order to do it you should set the pageSize of the DataSource to be equal to the total amount of records. In this way the dataSource.data() will contain all the records.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or