After visiting and using plenty of your solutions exposed in this great website, I've finally got across a problem that I can't find a solution anywhere.
I have a TreeView that is populating a XML file that looks like this:
Expand|Select|Wrap|Line Numbers
- <commandset>
- <commandgroup name="Initialization">
- <command name="Reset" id="1">
- ...
- </command>
- <command name="Reset" id="2">
- ...
- </command>
- <command name="Init" id="3">
- ...
- </command>
- </commandgroup>
- </commandset>
My problem starts when I try select one "command" node in the TreeView to extract the data from the XML (and at the end reflect the changes back to the original XML).
To select the XmlNode, I am creating an string with the path to the TreeNode "command" with a function that looks like this:
Expand|Select|Wrap|Line Numbers
- private string GetTreeNodePathExpresion()
- {
- string expr = null;
- string myNode = treeView1.SelectedNode.Text;
- expr = "/commandset/command [@name='" + myNode + "']";
- return expr;
- }
Is there any way I can identify the TreeNodes using a unique ID or something similar?
Thanks.