The docs for InitializeNode event says "This event is raised when a XamDataTreeNode is created."
I've been monitoring this event in the debugger (VS2010 & Infragistics 11.2) and it appears this event only gets raised as a node comes into view. This implies that a node only gets created when ever it comes into view.
On the other hand, the ScrollNodeIntoView Method says: "Scrolls a XamDataTreeNode into the viewable area.".
My dilemma is: Is nodes are created only when they are in view, how is it that ScrollNodeIntoView does what the documentation says it does?
As you can see, I need a better understanding of the XamDataTree.
Is there any documentation (Articles, etc.) that would provide better insight into the operation of XamDataTree?
Yes, with the understanding received from your sample, I was able to implement an even simpler sollution since I know my tree will never be more than 2 levels..
Thanks again,
Joe
Hi Joe,
Have you had a chance to re-visit this? Let me know if you have any questions.
Hello Rob,
Thank you very much for the code. That looks like a great solution. Unfortunately, I've been tied up on other issues but hope to get back to this over the week-end if not sooner.
The way I would handle search functionality would be to iterate over the CollectionViewSource.View collection using a recursive function to check each node's children and return the XamDataTreeNode that can then be used in the ScrollNodeIntoView method. The code would look something like this:
You can then just call SearchForNode and if the return value is not null, you can pass it to the ScrollNodeIntoView method.
Hi Rob,
I've been side tracked and unfortunately haven't attempted to implement your solution yet.
I think your solution works whenever a new item is added to the collection. In my scenario I first search for the item (level 0) and if found update it. If not found, then I add it.
I just haven't figured out the "search" case yet. I'm thinking I'll have to do a search on the CollectionViewSource since it is sorting, and get the index that way.
I realize this is not an Infragistics problem, but I'd be interested in your thoughts on this.