0

Hi..

I am populating treeview using XML and then trying to access the nodes of treeview
into webbrowser to view the files using the following code..

Can anyone please guide me with this??

private void treeView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            webBrowser1.Navigate(treeView1.SelectedNode.Text);
        }

The following is the function to build treeview:-

private void BuildTreeView(XmlDocument doc)
        {
            treeView1.Nodes.Clear();
            treeView1.Nodes.Add(new TreeNode(doc.DocumentElement.Name));
            TreeNode tNode = new TreeNode();
            tNode = treeView1.Nodes[0];

            AddNode(doc.DocumentElement, tNode);
            treeView1.ExpandAll();

        }
1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by bhagyap
0

It should be as follows:-

webBrowser.Navigate("E:\\testing\\"+treeview.SelectedNode.Text);

This will work perfectly fine...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.