I've already try that, see code.
My question now is how can I select the specific node?
private void bSearch_Click(o bject sender, System.EventArg s e)
{
TreeNode currentnode = new TreeNode();
try
{
foreach (TreeNode node in this.tvw.Nodes)
{
if (node.Text.Subs tring(0,this.tS earch.Text.Leng th).ToLower() ==
this.tSearch.Te xt.ToLower())
{
MessageBox.Show ("2");
break;
}
else
foreach (TreeNode node1 in node.Nodes)
{
if (node1.Text.Sub string(0,this.t Search.Text.Len gth).ToLower() ==
this.tSearch.Te xt.ToLower())
{
MessageBox.Show ("2");
break;
}
else
{
foreach (TreeNode node2 in node1.Nodes)
{
if (node2.Text.Sub string(0,this.t Search.Text.Len gth).ToLower() ==
this.tSearch.Te xt.ToLower())
{
currentnode = node2;
break;
}
}
}
}
}
Gaby
"Vijaye Raji" <no************ @hotmail.com> wrote in message
news:eI******** ******@tk2msftn gp13.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.n l> wrote in message
news:3f******** *************@n ews.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