Hello,
I am trying to get all the elements that are inside the <group> tag in
this function and it doesn't work.
What is wrong with that?
private void populateTreeControl(
System.Xml.XmlNode document,
System.Windows.Forms.TreeNodeCollection nodes)
{
XmlNodeList xmn = document.SelectNodes("/sectionGroup/*");
foreach (System.Xml.XmlNode node in
document)
{
string text = (node.Value != null ? node.Value :
(node.Attributes != null &&
node.Attributes.Count > 0 ) ?
node.Attributes[0].Value : node.Name);
TreeNode new_child = new TreeNode(text);
nodes.Add(new_child);
populateTreeControl(node, new_child.Nodes);
}
}
Thanks a lot!
*** Sent via Developersdex http://www.developersdex.com ***