I've already try that, see code.
My question now is how can I select the specific node?
private void bSearch_Click(object sender, System.EventArgs e)
{
TreeNode currentnode = new TreeNode();
try
{
foreach (TreeNode node in this.tvw.Nodes)
{
if (node.Text.Substring(0,this.tSearch.Text.Length).T oLower() ==
this.tSearch.Text.ToLower())
{
MessageBox.Show("2");
break;
}
else
foreach (TreeNode node1 in node.Nodes)
{
if (node1.Text.Substring(0,this.tSearch.Text.Length). ToLower() ==
this.tSearch.Text.ToLower())
{
MessageBox.Show("2");
break;
}
else
{
foreach (TreeNode node2 in node1.Nodes)
{
if (node2.Text.Substring(0,this.tSearch.Text.Length). ToLower() ==
this.tSearch.Text.ToLower())
{
currentnode = node2;
break;
}
}
}
}
}
Gaby
"Vijaye Raji" <no************@hotmail.com> wrote in message
news:eI**************@tk2msftngp13.phx.gbl...
You'll have to implement a SelectItem method yourself - and for that,
you'll probably have to recurse through all the nodes of the tree view and select
the one that matches your criteria.
-vJ
"G Uljee" <le***@xs4all.nl> wrote in message
news:3f*********************@news.xs4all.nl... How can I find and select an specific item in an treeview control?
I want to create a search feature on my treeview.
Thanks in advance,
Gaby