View previous topic :: View next topic |
Author |
Message |
ychung
Joined: 25 Jan 2007 Posts: 16
|
Posted: Thu Feb 01, 2007 3:14 pm Post subject: Is it possible to hide rows? |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Feb 01, 2007 9:28 pm Post subject: |
|
|
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 |
|
|
ychung
Joined: 25 Jan 2007 Posts: 16
|
Posted: Fri Feb 02, 2007 5:46 am Post subject: |
|
|
Thanks for pointing out some directions and I will give it a try. |
|
Back to top |
|
|
|