View previous topic :: View next topic |
Author |
Message |
jaherbert
Joined: 27 Jan 2008 Posts: 43
|
Posted: Fri Dec 03, 2010 3:06 am Post subject: FindRow(path).Path != path |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Dec 03, 2010 11:06 am Post subject: |
|
|
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 |
|
|
jaherbert
Joined: 27 Jan 2008 Posts: 43
|
Posted: Fri Dec 03, 2010 4:30 pm Post subject: |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Dec 05, 2010 10:10 pm Post subject: |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Dec 05, 2010 10:11 pm Post subject: |
|
|
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 |
|
|
jaherbert
Joined: 27 Jan 2008 Posts: 43
|
Posted: Tue Dec 07, 2010 11:16 pm Post subject: |
|
|
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 |
|
|
|