Forum Discussion
TanyaYatskovska
12 years agoSmartBear Alumni (Retired)
Hi Guillaume,
As you are using Data Binding, this behavior is expected as in this case, items of a tree view can contain complex objects that cannot be represented by a string value. We have a suggestion to implement support for such complex objects in our DB, and your request has increased its rating. Thanks.
In the meantime, as a workaround, you can create a script routine that will use native methods and properties of the tree view item to get an index of the needed item by its caption and then use the index as an argument of the ClickItem method. You can get access to the collection of tree view items by using the Items or wItems properties of the tree view object. To explore properties and methods of objects in your application, use the Object Browser panel.
Here is a template script function you can use.
'VBScript
...
itemIndex = getTreeItemIndex(tree, "Sally28")
Call tree.ClickItem(itemIndex)
...
Function getTreeItemIndex(tree, itemCaption)
getTreeItemIndex = -1
For i = 0 To tree.wItemCount - 1
currentItemCaption = tree.Items.Item(i).??? ' Find the property of an item object containing the caption of the item.
If itemCaption = currentItemCaption Then
getTreeItemIndex = i
Exit For
End If
Next
End Function
Related Content
- 3 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago