We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Urgent

hi Iam having treeview with several nodes in it.Iam doing some Search in this .if I want to search a particular node ,I''ll write in text box & click on the button.This will search tht particular node.But this will expand full nodes.Now my requirement is it should do search without visual expansion and stepping through branches and should only expand the active branch wherein the fragment is found. Also – when finding the next one, the previous should be collapsed if the next occurance is in a new branch (and the new one expanded). Can any one help this

4 Replies

MU Murugan Syncfusion Team July 3, 2006 07:57 PM UTC

Hi, This problem could be solved by using recursive function to find out the required node. After getting the resultant node use TreeviewAdv.CollapseAll() method to collapse tree structure.Then make the resultant node as selected node by assigning treeViewAdv.SelectedNode = node. public TreeNodeAdv FindNodeByText(Syncfusion.Windows.Forms.Tools.TreeNodeAdv node , string text) { if (node != null) { if (node.Text.ToUpper() == text.ToUpper()) { return node; } else { node = FindNodeByText(GetNextNode(node), text); } } return node; } The attached sample demonstrates this method.Please go through that and let me know,if you need more assistance. Thanks for your interest on Syncfusion products. Regards, Murugan PS

TreeViewSearch.zip


RE resmi July 6, 2006 06:43 AM UTC

Thnks


PR prethi July 14, 2006 04:47 AM UTC

In this sample,how will i search for the text in treeview,if iam using wildcard charcters. ForExa: If I want to search for murugan ,I''ll enter *rugan or mur* or *ru* .How i''ll do this type of search???


MU Murugan Syncfusion Team July 17, 2006 08:13 PM UTC

Hi Prethi, I have modified the sample based on your searching patterns. I have attached a sample for your reference. Please go through that and let me know if you need more assistance. Regards, Murugan P.S TreeViewSearch.zip

Loader.
Live Chat Icon For mobile
Up arrow icon