Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
925
Programmatically activate a node in Infragistics XamDataTree
posted

Hi, I'm having a problem with XamDataTree, that has already been reported on stackoverflow: http://stackoverflow.com/questions/6295882/programmatically-activate-a-node-in-infragistics-xamdatatree

I'll simply cut&paste the question on stackoverflow, since it exactly matches my situation. Do you have any suggestion? Thanks a lot, cheers!

--

I'm using Infragistics NetAdvantage for Win Client 2010 Vol. 3.

I made a WPF User Control that shows some nested items using a XamDataTree control. Tree nodes are loaded from a binded Observable item collection:

MenuNode menuTree = getMenuTree(true);
ObservableCollection<MenuNode> menuNodes = menuTree.children;
this.treeFP.ItemsSource = menuNodes;

I couldn't find a suitable tree method that activates a node based on certain property (eg. a key?). So I created a method that loops through the whole tree, until it finds the correct node to activate:

void selectNode(XamDataTreeNodesCollection nodes, string nodeKey)

I then called this method in this way:

selectNode(theTree.Nodes, "KEYTOSELECT");

It turned out that theTree.Nodes collection is empty! Why? Probably because items source is binded? If this behaviour is correct (?), is there another way to activate a single node?

--

 

Parents Reply Children