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();

        }

It should be as follows:-

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

This will work perfectly fine...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.