Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How does Virtual Loading work?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> Virtual Tree FAQ
View previous topic :: View next topic  
Author Message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue May 02, 2006 11:32 pm    Post subject: How does Virtual Loading work? Reply with quote

Virtual Tree is designed from the ground up to be data bound (it doesn't have an unbound mode). This means that it is in full control over the requesting of data from the data source and is able to leverage this to only request the data items that are required to support the current display.

Items displayed in the tree are obtained through the standard .NET IList interface. Virtual Tree uses three methods from this interface:
  • Count - returns the number of items in the list. This is used by Virtual Tree to establish whether the expand icon should be shown next to the parent item (if the ChildPolicy for the row is not LoadOnExpand) and for expanded items is also used to determine the scrollbar dimensions and position.
  • Item[index] - returns the item at a given index in the list. This is only called for those items that Virtual Tree is currently displaying. This means that even if your Data Source has 30000 items Virtual Tree will typically only call the Item method about 30 times to get the data to display the first 30 rows.
  • IndexOf(Item) - returns the index of the given item in the list. This is used by VirtualTree when locating items within the tree hierarchy.

For simple in-memory data sources (such as an ArrayList) this design means that Virtual Tree does not spend time loading and creating visual representations for items which are never displayed.

More advanced data sources can implement the IList interface so that items are only loaded into memory as required. This can greatly reduce both the memory requirements and also initial load times for applications. Infralution's Virtual Data Objects uses this mechanism to allow browsing of very large databases using server side cursors - providing very quick startup times with minimal memory footprint.

You can also take advantage of this mechanism for your own data sources by simply implementing the IList interface for your own collection. The big advantage of leveraging the IList interface (as opposed to other virtual loading schemes) is that, because the virtual loading is defined in the data layer, all controls* and parts of your application that use the data source can take advantage of it.

* NOTE the standard .NET ListBox and ComboBox controls do not make intelligent use of the IList interface when using databinding. Instead they iterate through the entire collection (twice Sad ) when data source is set. For this reason Infralution includes VirtualListBox and VirtualDropDownList controls when you purchase Virtual Tree.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> Virtual Tree FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group