Forum Discussion

yingkai1208's avatar
yingkai1208
Contributor
13 years ago

Click an item by its name in a treeview

Hi, I want to click an item by its name in a treeview. For example, I want to click A_Mixed_US_2012 in the attachment of Capture 1. The only feasible approach I have tried is  :

PROJECT_TREEVIEW.ClickItem("|[2]")



PROJECT_TREEVIEW is the alias of the mapped name of the treeview.



The Capture 2 in the attachment is the Object Browser for the treeview



I tried the following approaches. Neither of them is feasible.



  1. PROJECT_TREEVIEW.ClickItem("|A_Mixed_US_2012 ")


  2. PROJECT_TREEVIEW.ClickItem("||A_Mixed_US_2012 ")


  3. PROJECT_TREEVIEW.ClickItem("|[2]|A_Mixed_US_2012 ")


Any suggestion is appreciated. Thanks in advance.

2 Replies

  • Did you tried to record such an action and see what code will be generated?

  • Hi Kai,


     


    Is Data Binding used in your control? In this case, it's expected that you can click an item only by its index. Refer to this post for details.