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

Grid local data add data and update grid

3 Answers 384 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gavidia Gonzalez
Top achievements
Rank 1
Gavidia Gonzalez asked on 02 Mar 2016, 05:47 PM

Hi,

i have a question, i have a grid populated with local data (array of data), i need to insert more rows to my data array and then refresh the grid without the Grid redraw all the items. For example if i have 20 items on my grid and into my data array and then the user execute load more (other 20), into my code  load the 20 more records into my array data (pushing) and the dataBound event is fired. Then the Grid takes the 40 records again not just the 20 more.

Can some one help me?

Sorry about my english.

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 04 Mar 2016, 12:39 PM
Hi,

If I understand you correctly, the best approach in that case would be to re-assign the data of the data source with the new items. This will remove the previously visible ones and show the new items.

Apart from that, the grid will always re-draw itself when the datasource contents are changed - there are no means to avoid that. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Gavidia Gonzalez
Top achievements
Rank 1
answered on 07 Mar 2016, 07:09 PM

Hello, thanks for the answer.

I am changing the grid implementation. Now the data comes from a direct connection (trhourg transport read method) with a remote service (Delphi with Indy components). In this scneario I wonder if the virtual scrolling draw just the new items and I can add attributes to each one.

I am implementing an eccomerce portal so I need to display always all the items but loading them by parts, this why the virtual scrolling is (I guess) what i need.

Thanks in advance.

0
Accepted
Petyo
Telerik team
answered on 10 Mar 2016, 08:39 AM
Hello,

the virtual scrolling of the grid dynamically removes and adds several items given the scroll behavior. Relying on items being present in the DOM (or not being redrawn) is nto a good idea. Notice that items further above the scroll area are removed for performance reasons. As a matter of fact, you can observe this behavior with your browser developer tools.

Regards,
Petyo
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
Gavidia Gonzalez
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Gavidia Gonzalez
Top achievements
Rank 1
Share this question
or