Page 1 of 1

TreeViewSelectItem question

Posted: Thu Nov 29, 2007 7:11 pm
by jasong
I used the following:

Code: Select all

TreeViewSelectPath(control, 'level1/level2')
parent = TreeViewGetSelectedItem(control)
child = TreeViewGetChildItem(control, parent)
TreeViewSelectItem(control, child)
what I get is an 'argument error' for TreeViewSelectItem.

I have verified with TreeViewGetItemText that the child item handle is correct.

Posted: Fri Nov 30, 2007 4:43 pm
by Support Team
Sorry, this is a bug in the Python documentation, the second argument of the function should be the text of the item and not the handle.
See also the sample TreeViewTest in the Ranorex Scripts directory.

Please use the following code:

Code: Select all

TreeViewSelectPath(control, 'level1/level2') 
parent = TreeViewGetSelectedItem(control) 
child = TreeViewGetChildItem(control, parent) 
childText = TreeViewGetItemText(treeView,child)
TreeViewSelectItem(control, childText)     
We have corrected the documentation for the next release.

Jenö
Ranorex Support Team