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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Search Capability in TreeView

Thread ID:

Created:

Updated:

Platform:

Replies:

32507 Aug 2,2005 04:20 PM UTC Jul 2,2009 09:56 AM UTC WinForms 6
loading
Tags: Tools
Vinay
Asked On August 2, 2005 04:20 PM UTC

Hello All, My Requirement is to include a search functionality inside a TreeView. Can anyone suggest some options in Essential TreeViewAdv which will help me in this regard. Thanks in Advance. Regards Vinay.

Administrator [Syncfusion]
Replied On August 2, 2005 04:31 PM UTC

Hi Vinay, The best way to search TreeViewAdv is a simple recursive function that you pass the TreeViewAdv.Nodes collection into. public TreeNodeAdv FindNodeByText(TreeNodeAdvCollection nodeCollection, string text) { if (nodeCollection == null) { return null; } foreach (TreeNodeAdv node in nodeCollection) { if (node.Text = text) { return node; } else { TreeNodeAdv tempNode = FindNodeByText(node.Nodes, text); if (tempNode != null) { return tempNode; } } } return null; } Regards, Gregory Austin Syncfusion Inc.

Scott Swartz
Replied On June 29, 2009 03:58 PM UTC

Other than one compile issue, that worked great:

Note that:
if (node.Text = text)

should be:
if (node.Text == text)

You guys should really look at making this a method.

Fathima Shalini P [Syncfusion]
Replied On July 1, 2009 12:22 PM UTC

Hi Scott,

Need a method to find the TreeNodeAdv using its text

On our initial analysis we have found that the above issue could be a feature request. We have forwarded this to our developers for more analysis. We will getback to you on or before July 1st 2009.

Please let me know if you have any concerns.

Regards,
Fathima

Fathima Shalini P [Syncfusion]
Replied On July 1, 2009 12:24 PM UTC

Hi Scott,

Thank you for your update.

Need a method to find the TreeNodeAdv using its text

On our initial analysis we have found that the above issue could be a feature request. We have forwarded this to our developers for more analysis. We will getback to you on or before July 8th 2009.

Please let me know if you have any concerns.

Regards,
Fathima

Scott Swartz
Replied On July 1, 2009 01:34 PM UTC

Note that in the end I wrote a method that find's the node based on it's path. It takes a string path and string dellimiter. I had to do this because in my tree some of the leaves have the same name.

Fathima Shalini P [Syncfusion]
Replied On July 2, 2009 09:56 AM UTC

Hi Scott,

Thank you for your update.

I have forwarded your request to our developers. We will get back to you on or before July 8th 2009.

Please let me know if any concerns.

Regards,
Fathima

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;