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 

Is it possible to hide rows?

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
ychung



Joined: 25 Jan 2007
Posts: 16

PostPosted: Thu Feb 01, 2007 3:14 pm    Post subject: Is it possible to hide rows? Reply with quote

Hi,

I have a tree datasource like:

Code:
Item
{
  Item Parent;
  Item[] Children;
}


I would like to toggle show/hide on some items...
For now, the only method I can think of is to remove them from the tree structure and call UpdateRows(). Is there other possible approaches to archive this?

Thanks!
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Feb 01, 2007 9:28 pm    Post subject: Reply with quote

Virtual Tree needs to know how many children a given expanded row has in order to size the scrollbar correctly. If rows could be hidden then the only way that VirtualTree could calculate how many visible rows there are would be to iterate over them all to check which ones were hidden (which would negate the virtual loading mechansim that Virtual Tree uses).

There is however an alternative to restructuring your data objects by removing items from the Item.Children collection. Instead of using ObjectBinding to set the ChildrenProperty you would use the VirtualTree.GetChildren event to return the children. In this event you would create a new collection and iterate over the Item.Children collection only adding those child items which should not be hidden to the new collection. Obviously this does negate the virtual loading mechanism to some degree as discussed above - but if you don't have a large number of children per node it is probably OK.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
ychung



Joined: 25 Jan 2007
Posts: 16

PostPosted: Fri Feb 02, 2007 5:46 am    Post subject: Reply with quote

Thanks for pointing out some directions and I will give it a try.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support 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