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

Question data virtualization and ItemsLoading

7 Answers 170 Views
Data Virtualization
This is a migrated thread and some comments may be shown as answers.
Austin
Top achievements
Rank 1
Austin asked on 29 Jan 2013, 10:45 PM
Hi,

From what I understand the purpose of data virtualization is to only keep a finite number of records in memory at any given time.  However, while experimenting I found that the ItemsLoading event only gets called while I scroll down to the bottom of the RadGridView.  Once I am at the final row and start scrolling back up it is no longer being called.  This has led me to believe that records are not being unloaded from memory once they have been scrolled out of view.

I am wondering if I am missing something as I do not see any cache size member to set how many things to hold in memory at one time.  Any guidance on how to properly utilize the VirtualQueryableCollectionView with the RadGridView would be greatly appreciated.  The example posted is for RIA services, but we are not using RIA.

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Jan 2013, 02:40 PM
Hello,

 Actually the virtual collection works in a bit different way. You always have strict number of total items (VirtualItemCount) and the collection itself initially is a collection of empty (null) items. When you scroll down the ItemsLoading event will be called and empty (null) items in the collection will be replaced with the new items. When an item is already loaded the collection will not call ItemsLoading event for this item. 

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Austin
Top achievements
Rank 1
answered on 30 Jan 2013, 03:03 PM
Hey Vlad,

I have witnessed the behavior you described and it is what I would expect.  However, I am wondering if there is any built in way of setting items of the internal list back to null once they are scrolled out of view.  As it stands if a user slowly scrolled through a data set containing 1,000,000 records; eventually there would be 1,000,000 items sitting in memory which is exactly what I hope to avoid by using data virtualization.

My main question is whether or not I need to implement my own custom algorithm for clearing records that have been scrolled out of view, or is there a built in way of doing this that I have overlooked?

Thanks for the reply,
Austin
0
Accepted
Vlad
Telerik team
answered on 30 Jan 2013, 03:16 PM
Hello Austin,

 There is no built-in algorithm for cleaning items when they are out of view. 

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Austin
Top achievements
Rank 1
answered on 30 Jan 2013, 03:28 PM
Alright, thanks for the info.  In that case, is there a method of clearing your would recommend?  From what I can see going into the internal list and setting out of view items back to null would be the way to do it.
0
Vlad
Telerik team
answered on 30 Jan 2013, 03:46 PM
Hi,

 Indeed setting the item back to null may do the trick. 

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Austin
Top achievements
Rank 1
answered on 30 Jan 2013, 07:51 PM
Hey Vlad,

So while trying to implement a solution for this I have run into an issue.  I have derived the VirtualQueryableCollectionView class in order to get access to the InternalList member so that I can set the values at various indices back to null.  However, there is a private member called:  loadedIndexes

As far as I can tell, this private list keeps track of which indexes have been loaded and tells the virtualization methods to not go re-fetch them when they scroll into view.

Thus once I set InternalList items back to null I have no way of telling loadedIndexes to clear out those indices and these rows will not be reloaded upon scrolling back into view which leaves them as blank rows.

I don't want to call .Refresh() to get this job done as it causes the grid to flash and would be a huge performance hit.

I really and I mean REALLY don't want to be forced to use reflection to get at this loadedIndexes member in order to do what I need to do.  Being forced into solutions involving reflection was a primary reason why we moved away from a different control vendor in the past.

Is there any way around this issue you can recommend, or would you guys consider adding some members that expose the functionality I am looking for?
0
Vlad
Telerik team
answered on 31 Jan 2013, 08:22 AM
Hello,

 I've replied to your other thread.  

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Data Virtualization
Asked by
Austin
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Austin
Top achievements
Rank 1
Share this question
or