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 

FindRow(path).Path != path

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



Joined: 27 Jan 2008
Posts: 43

PostPosted: Fri Dec 03, 2010 3:06 am    Post subject: FindRow(path).Path != path Reply with quote

I'm using v3.15.1 with DataSet binding.

If I call FindRow with path A>B>C, the path of the found row is A>B>D.

But if I call FindRow(object) with the last item in the path, it finds the right row (as long as there's a single parent).

There's some custom GetParent handling to differentiate among multiple parent paths.

I've not overridden any equality f()s and there are no Output messages.

Thoughts?

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



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Dec 03, 2010 11:06 am    Post subject: Reply with quote

If you could modify one of the standard sample projects (or create your own small project) to demonstrate the issue that would assist us a lot in finding what the problem might be. You can email a zipped copy of the sample to support@infralution.com
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
jaherbert



Joined: 27 Jan 2008
Posts: 43

PostPosted: Fri Dec 03, 2010 4:30 pm    Post subject: Reply with quote

I don't suspect I'll be able to modify one of the sample projects to do this, and I don't think it will be easy to create one from scratch.

I might be able to narrow it down by some further investigation on my end. Any suggestions on where to look?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Dec 05, 2010 10:10 pm    Post subject: Reply with quote

I've just tested the FindRow(IList path) method with the standard DataSet Browser sample and wasn't able to find any issues - which makes me suspect the problem may be in your custom GetParent handling.

VirtualTree.FindRow(IList path) just calls Row.FindDescendantRow for the root row. So ne thing you can try is to first call FindRow with A>B. Then you can call Row.FindDescendantRow with just C. This should actually be the same as calling Row.ChildRow(C).

Note that you can't use this form of FindRow if an object is not unique within its parent. If you have the same object more than once within the child objects then you need to use the FindRowByIndex method to properly differentiate.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Dec 05, 2010 10:11 pm    Post subject: Reply with quote

I've just tested the FindRow(IList path) method with the standard DataSet Browser sample and wasn't able to find any issues - which makes me suspect the problem may be in your custom GetParent handling.

VirtualTree.FindRow(IList path) just calls Row.FindDescendantRow for the root row. So one thing you can try is to first call FindRow with A>B. Then you can call Row.FindDescendantRow with just C. This should actually be the same as calling Row.ChildRow(C).

Note that you can't use this form of FindRow if an object is not unique within its parent. If you have the same object more than once within the child objects then you need to use the FindRowByIndex method to properly differentiate.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
jaherbert



Joined: 27 Jan 2008
Posts: 43

PostPosted: Tue Dec 07, 2010 11:16 pm    Post subject: Reply with quote

It looks like the problem was in updating children. I'm performing a custom drag/drop and the tree appeared to recognize the new DataRow (i.e., it displayed it in the right place). However, the children of the penultimate VT row (on the path) weren't quite right (NumChildren was correct, ChildItems was correct, but ChildRowByIndex would return the same item for two different indices). Calling UpdateChildren straightened things out.

Thanks for the help.
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