I would like to select one of the child node of my treeview get selected programatically. My treeview is as follow at run time
Root |->A.txt(I wo
Atlast i got the answer
TreeNode TvNode = tvwACH.SelectedNode.Parent; while (TvNode != null) { if (TvNode.Text.EndsWith(".txt", true, System.Globalization.CultureInfo.InvariantCulture)) { tvwACH.SelectedNode = TvNode; TvNode = null; } else TvNode = TvNode.Parent; }