i have done the job this way
private bool SearchRecursive(IEnumerable nodes, string searchFor)
{
foreach (TreeNode node in nodes)
{
if (node.Text.ToUpper().Contains(searchFor))
{
treeView1.SelectedNode = node;
node.BackColor = Color.Yellow;
}
if (SearchRecursive(node.Nodes, searchFor))
return true;
}
return false;i want to search data in treeview by LINQ and if data found the change the node color & expand. set the node color like selection color. if search text is empty then remove the color.
how to do the whole thing using LINQ with treeview instead of loop ? thanks