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

Need search option in tree view control

Hi, 
     I have been using tree view control with checkbox and i need an option to search node in tree view using a text box. Is it possible? kindly share a code or example.




Regards, 
Justin Ebenezer

3 Replies

CI Christopher Issac Sunder K Syncfusion Team April 1, 2019 05:25 AM

Hi Justin Ebenezer, 

Greetings from Syncfusion!!! 

We have prepared a custom sample to filter Treeview nodes. Please check the below link 

In this sample, we have used a textbox for filtering Treeview items and in the change event of Textbox, we have filtered the items using Datamanager to update the Treeview datasource. 

Please check and get back to us if you have any further concerns. 

Thanks,
Christo 



EB Ebenezer April 2, 2019 06:59 AM

Hi, 
     I just saw your example back then, having some issues while using that. 

1. If i check a node using search input option then corresponding node was still unchecked once i clear the input.
2. "let query = new Query().where(new Predicate.or(predicats));" compile error, that it should be void.
3. If i check some nodes without using search option and then if i try to search 'em it shows as unchecked.


Regards, 
Justin Ebenezer


CI Christopher Issac Sunder K Syncfusion Team April 3, 2019 07:55 AM

Hi Justin Ebenezer, 

Thanks for the update. 

We have resolved the search and checking tree nodes while performing search operation related issues. In the provided sample, we have maintained the checked nodes in a private array and update it while changing the dataSource in the dataBound event. Also we disabled the autoCheck to achieve independent behavior of checked state.  


Please check the updated sample and let us know if you have any concerns. 

Thanks, 
Christo 


Loader.
Live Chat Icon For mobile
Up arrow icon