How to capture Child Name and the Parent Name in a tree view in WPF + MVP
-
Hello All, I am working on WPF application with MVP architecture. My question is : how to get the name of the selected node in a tree? Also, i need to get the name of the parent node that the selected node belongs to. Node1 A1 A2 A3 A4 Node2 A1 A2 A5 A8 Node3 A1 A2 A9 Asin the treeview, it has 3 nodes and each node having children. If I select the Child A2, from Node3, how can this be stored in a string? and also I should get the parent of this A2(which is Node3). So, on selection of A2 in Node3, I should have the names of A2 and its parent node. I am doing it in C#. Please help me. Thank You, Ramm
-
Hello All, I am working on WPF application with MVP architecture. My question is : how to get the name of the selected node in a tree? Also, i need to get the name of the parent node that the selected node belongs to. Node1 A1 A2 A3 A4 Node2 A1 A2 A5 A8 Node3 A1 A2 A9 Asin the treeview, it has 3 nodes and each node having children. If I select the Child A2, from Node3, how can this be stored in a string? and also I should get the parent of this A2(which is Node3). So, on selection of A2 in Node3, I should have the names of A2 and its parent node. I am doing it in C#. Please help me. Thank You, Ramm
You probably need to check the events raised by TreeView. I would expect that a click or select event of some form is raised when the user clicks a node, and the code behind should be able to capture that event, which will likely have a reference to the selected node. Each node in the tree has a parent property that can be used to traverse the tree to its main root. Try a search for TreeView in MSDN and look at the Properties and Events.