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 

UpdateRows() crashes if underlying data is deleted

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



Joined: 16 Nov 2010
Posts: 2

PostPosted: Tue Nov 16, 2010 8:55 pm    Post subject: UpdateRows() crashes if underlying data is deleted Reply with quote

UpdateRows() crashes if underlying data

Hi

If the collection given to DataSource has been invalidated and then cleared of all elements, and UpdateRows() is called later when the tree control becomes visible again, I get:

StackTrace " at Infralution.Controls.VirtualTree.Row.Dispose()\r\n at Infralution.Controls.VirtualTree.Row.UpdateChildrenNoReindex(Boolean reloadChildren, Boolean recursive)\r\n at Infralution.Controls.VirtualTree.Row.UpdateChildren(Boolean reloadChildren, Boolean recursive)\r\n at Infralution.Controls.VirtualTree.VirtualTree.UpdateRows(Boolean reloadChildren)\r\n at Infralution.Controls.VirtualTree.VirtualTree.UpdateRows()\r\n...

Since I know the data source is kaput, is there some way to reset the tree control back to a clean slate when it becomes visible? This is after its containing control became invisible via tab selection but not destroyed. The tree control would still have any properties it had when previously visible, but I am happy to start from scratch.

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



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Nov 16, 2010 9:46 pm    Post subject: Reply with quote

What version of Virtual Tree are you using?

I've tried to replicate this issue using the Simple Tree sample project by adding a Dispose method to Part class that recursively clears the child collections as below:

Code:
public void Dispose()
{
    foreach (Part part in _childParts)
    {
        part.Dispose();
    }
    _childParts.Clear();
    _parentPart = null;
    _childParts = null;
}


If a call this on the root Part object and then call UpdateRows it all behaves as expected. If you can replicate the problem in a small sample project it would help us track down the underlying issue.

One thing you could try is (instead of calling UpdateRows) set the DataSource to null and then to your new Datasource.
_________________
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