View previous topic :: View next topic |
Author |
Message |
bhofmann
Joined: 20 Aug 2007 Posts: 26
|
Posted: Fri Aug 01, 2008 9:30 am Post subject: Invalidate row's children |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sat Aug 02, 2008 12:18 am Post subject: |
|
|
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 |
|
|
bhofmann
Joined: 20 Aug 2007 Posts: 26
|
Posted: Sat Aug 02, 2008 10:17 am Post subject: |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sat Aug 02, 2008 10:36 pm Post subject: |
|
|
Sure, email the code to support@infralution.com and we will take a look. _________________ Infralution Support |
|
Back to top |
|
|
|