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(leaf node) returns Row for root node.

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



Joined: 10 Apr 2008
Posts: 32

PostPosted: Wed Jul 08, 2009 5:33 am    Post subject: FindRow(leaf node) returns Row for root node. Reply with quote

FindRow(leaf node) returns Row for root node. The Item property of the row is set to the Root node. What could be wrong?

My end goal is to obtain the previous leaf node given a current leaf node. If the current leaf node is non-zero it is easy (decrement the child index) but when i have to move to a sibling parent collection it gets a bit more tricky. I was hoping to be able to figure out the previous parent's last leaf node given the first leaf node in the next parent node....
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jul 08, 2009 11:30 pm    Post subject: Reply with quote

If you just want the previous row displayed in the tree then you can use the Row.RowIndex and call VirtualTree.GetRow(Row.RowIndex - 1).

This will only get the previous visible row however. If the previous row is not expanded then you won't traverse to its children.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
JohnSummit



Joined: 10 Apr 2008
Posts: 32

PostPosted: Mon Jul 13, 2009 12:31 am    Post subject: Reply with quote

The problem is that anytime i want to retrieve the object for a row via the FindRow function i get the root object back. The parent/child properties of my objects appear to be setup correctly and no warnings are output when debugging.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jul 13, 2009 2:53 am    Post subject: Reply with quote

Quote:
The problem is that anytime i want to retrieve the object for a row via the FindRow function i get the root object back


I assume you actually mean:

"anytime i want to retrieve the row for an object"

Since FindRow gives you the Row for a domain object. Which overload version of FindRow are you calling. One of the overloads takes a list of objects (as an IList parameter) which defines the full path to the object you want to find the Row for. If the object you are trying to find the row for happens to support IList then you might be actually calling the wrong overload by accident. To ensure this isn't the case you can force calling the other overloaded method by casting to object eg:

Code:
_virtualTree.FindRow((object)list);

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
JohnSummit



Joined: 10 Apr 2008
Posts: 32

PostPosted: Mon Jul 13, 2009 3:34 am    Post subject: Reply with quote

Good catch! My tree node objects are indeed implementing IList. After an 'object' cast i can now retrieve the row for an arbitrary tree node object. Thanks for your 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