M
Manfred Braun
Hi All,
what I am trying to do is:
- create the root-node via Code
- add subtrees from xml-file(s)
My code do not fail, but my newly created nodes do not have a subtree or any
content.
I have the following code [excepert, "TreeView1" is my treeview]
private void Page_Load(object sender, System.EventArgs e)
.................
TreeView1.TreeNodeTypeSrc = defaultNodeTypesFilename;
TreeNode treenode = new TreeNode();
treenode.Target = "Content";
treenode.Type = "Item";
treenode.Text = "Overview";
treenode.NavigateUrl = "Overview.htm";
TreeView1.Nodes.Add(treenode); //ok [root]
AddNode(TreeView1); //ok
AddNodeFromXml(TreeView1, staticXml, staticXsl); //empty node, no
tree
TreeView1.SelectedNodeIndex = dynamicStartNodeIndex;
TreeView1.DataBind();
}
private void AddNodeFromXml(TreeView tv, string xmlFilename, string
xslFilename) //empty result
{
TreeNode treenode = new TreeNode();
treenode.TreeNodeSrc = xmlFilename;
treenode.TreeNodeXsltSrc = xslFilename;
tv.Nodes.Add(treenode);
}
private void AddNode(TreeView tv) // works
{
TreeNode treenode = new TreeNode();
treenode.Target = "Content";
treenode.Type = "Item";
treenode.Text = "Test from AddNode()";
treenode.NavigateUrl = "empty.htm";
tv.Nodes.Add(treenode);
}
If I load my files into the TreeView itself, the tree is build and
displayed. And my xml/xsl is correct.
Any help would be great!!!!!
Best regards,
Manfred Braun
(Private)
Mannheim
Germany
mailto:[email protected]
(Remove the anti-spam-underscore to mail me!)
what I am trying to do is:
- create the root-node via Code
- add subtrees from xml-file(s)
My code do not fail, but my newly created nodes do not have a subtree or any
content.
I have the following code [excepert, "TreeView1" is my treeview]
private void Page_Load(object sender, System.EventArgs e)
.................
TreeView1.TreeNodeTypeSrc = defaultNodeTypesFilename;
TreeNode treenode = new TreeNode();
treenode.Target = "Content";
treenode.Type = "Item";
treenode.Text = "Overview";
treenode.NavigateUrl = "Overview.htm";
TreeView1.Nodes.Add(treenode); //ok [root]
AddNode(TreeView1); //ok
AddNodeFromXml(TreeView1, staticXml, staticXsl); //empty node, no
tree
TreeView1.SelectedNodeIndex = dynamicStartNodeIndex;
TreeView1.DataBind();
}
private void AddNodeFromXml(TreeView tv, string xmlFilename, string
xslFilename) //empty result
{
TreeNode treenode = new TreeNode();
treenode.TreeNodeSrc = xmlFilename;
treenode.TreeNodeXsltSrc = xslFilename;
tv.Nodes.Add(treenode);
}
private void AddNode(TreeView tv) // works
{
TreeNode treenode = new TreeNode();
treenode.Target = "Content";
treenode.Type = "Item";
treenode.Text = "Test from AddNode()";
treenode.NavigateUrl = "empty.htm";
tv.Nodes.Add(treenode);
}
If I load my files into the TreeView itself, the tree is build and
displayed. And my xml/xsl is correct.
Any help would be great!!!!!
Best regards,
Manfred Braun
(Private)
Mannheim
Germany
mailto:[email protected]
(Remove the anti-spam-underscore to mail me!)