I want to refresh treeview with new value
<p>I use the following code to display xml as a treeview.</p>

<p>Now I want to refresh when I edit xml by using some text box in same window. When I edit and save file using textbox I want to refresh treeview also with that new value. </p>

<p>How can I do it?</p>

<p>I use <code>treeview1.update();</code> and <code>treeview1.refresh();</code> but it's not working.</p>

<p>I used the following code part:   </p>

<pre><code>private void button1_Click(object sender, EventArgs e)
{
    XmlDataDocument xmldoc = new XmlDataDocument();
    XmlNode xmlnode ;
    FileStream fs = new FileStream("tree.xml", FileMode.Open, FileAccess.Read);
    xmldoc.Load(fs);
    xmlnode = xmldoc.ChildNodes[1];
    treeView1.Nodes.Clear();
    treeView1.Nodes.Add(new TreeNode(xmldoc.DocumentElement.Name));
    TreeNode tNode ;
    tNode = treeView1.Nodes[0];
    AddNode(xmlnode, tNode);
}

private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)
{
    XmlNode xNode ;
    TreeNode tNode ;
    XmlNodeList nodeList ;
    int i = 0;
    if (inXmlNode.HasChildNodes)
    {
        nodeList = inXmlNode.ChildNodes;
        for (i = 0; i &lt;= nodeList.Count - 1; i++)
        {
            xNode = inXmlNode.ChildNodes[i];
            inTreeNode.Nodes.Add(new TreeNode(xNode.Name));
            tNode = inTreeNode.Nodes[i];
            AddNode(xNode, tNode);
        }
    }
    else
    {
        inTreeNode.Text = inXmlNode.InnerText.ToString();
    }
}
</code></pre>
