Is it possible to add two nodes at a time dynamically to a treeview
- by Dorababu
I am having a tree-view on my main form with initially some nodes as follows
ACH
|-> some.txt
|->FileHeader
|->BatchHeader
Now at this point i will have to add 2 child nodes at a time to BatchHeader. This nodes i will pass as strings from child forms
My sample code that i added some nodes is as follows
public void loadingDatafrom(string filename, bool str)
{
if (Append.oldbatchcontrol != filename)
{
if (tvwACH.SelectedNode.Text == "FileHeader")
{
tvwACH.SelectedNode.Nodes.Add(filename);
}
if (tvwACH.SelectedNode.Text == "BatchHeader" && filecontrolvariables.m_gridclick == false)
{
tvwACH.SelectedNode.Nodes.Add(filename);
**I got this idea tvwach.SelectedNode.Lastnode.Nodes.Add("Node");**
}
}
}
Can any one give an idea to add 2 nodes as child to the existing node ..