In answer to your first question, you have to iterate your TreeNodes
recursively, such as
private TreeNode SearchNodes(string nodeName)
{
foreach(TreeNode node in myTreeView.Nodes)
{
if (string.Compare(nodeName, nodeText, true) == 0)
{
return node;
}
TreeNode foundNode = null;
foreach(TreeNode childNode in node.Nodes)
{
foundNode = SearchNodes(nodeName);
if (foundNode != null)
{
return foundNode;
}
}
}
return null;
}
As for your second question, just handle the AfterSelect event of your
TreeView and then use the SelectedNode property to determine which node was
selected.
HTH,
DalePres
MCAD, MCDBA, MCSE
"Hrvoje Voda" <hr*********@luatech.com> wrote in message
news:d1**********@ls219.htnet.hr...
I manage to fill treeview control with data and I would like to search
through that data.
In child I have names of films, and when I click on one of them I would
like to show it's information in grid.
How?
Hrcko