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 

Invalidate row's children

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



Joined: 20 Aug 2007
Posts: 26

PostPosted: Fri Aug 01, 2008 9:30 am    Post subject: Invalidate row's children Reply with quote

Hello,

Sometimes I'd like to invalidate the children of a row, ie tell the tree that the row's children are out of date, but not force a refresh immediately.

If the row is collapsed, and its children are not visible, maybe never loaded, then nothing would happen until the user expands the row.
On the other hand, if the row is expanded and its children are visible then it would be refreshed.

Is this possible currently?

Thanks in advance.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Aug 02, 2008 12:18 am    Post subject: Reply with quote

Does your data source use the IBindingList.ListChanged event to notify the tree of changes or does your code call the VirtualTree.UpdateRows directly when the data changes?

If your data supports IBindingList.ListChanged then you can suspend handling of notifications by calling VirtualTree.SuspendDataUpdate. This is useful if you have a group of changes you need to make which would normally result in individual updates.

If you are calling VirtualTree.UpdateRows directly you can instead find the Row object and call Row.UpdateChildren to update only that child. There is however no way to suspend this. If you wanted that you would need to keep a list of the items that had changed and then handle it yourself.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
bhofmann



Joined: 20 Aug 2007
Posts: 26

PostPosted: Sat Aug 02, 2008 10:17 am    Post subject: Reply with quote

Hello,

Thank you for your answer. I'm currently using Row.UpdateChildren, but it loads children even for rows that were never loaded, so it's too much.

Since I have the source, I added a function to Row called InvalidateChildren, that does the same as UpdateChildren, except that when its children haven't been loaded yet it does nothing, and if it's collapsed it unloads the children. If it's possible to add this to your source let me know I'll send it to you.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Aug 02, 2008 10:36 pm    Post subject: Reply with quote

Sure, email the code to support@infralution.com and we will take a look.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
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