Hi Assaf,
Thanks for choosing Syncfusion products.
We have created a simple sample based on your requirement and the sample can be downloaded from the following location:
Sample:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=treeview5-7830128.zipWe have illustrated about the SearchItemByPath Method below:
New method ' SearchItemByPath ' has been provided to search the items by providing treeviewitem header path and final return value of this method is the treeviewitem which has been searched.
Overloaded Methods of SearchItemByPath :
1) SearchItemByPath(string path, char pathseperator)
- where path can be defined as 'Well1:Run1' where Well1 is first level TreeViewItem Header and Run1 is the next level TreeViewItem Header which is the child of Well1 and charseperator is ':'.
2) SearchItemByPath(string path, char pathseperator, bool IsSelected)
- Similar to first method which returns the treeviewitem of Run1 and the third bool parameter decides the treeviewitem to be selected or not.
3) SearchItemByPath(string path, char pathseperator, string propertyname)
- This method is also similar to first method but this method used to search when treeviewitem are added as collection objects and binded to Itemsource. Here instead of Header you can specify the value of object as path. For example Well is the class with Name and Description and these object has been binded as treeviewitem then you can mention the path hierarchy using name or description value if name is used for Path then that corresponding third parameter should be "Name".
4) SearchItemByPath(string path, char pathseperator, string propertyname, bool IsSelected)
- Similar to third method which returns the treeviewitem and the fourth bool parameter decides the treeviewitem to be selected or not.
Please let us know if you have any questions about this.
Regards,
Karthika
treeview5_d6fe986d.zip