Forum Discussion

Natasha_2012's avatar
Natasha_2012
Contributor
9 years ago

How to select invisible row on the screen of a TreeView Object

Hi Community

 

I have a treeview object which has 30 rows.  But my screen can display only 5 rows.  How can I select those invisible row

 

I have tried these following but they are all failed.  Error Unable to find the object SelectItem/ClickItem

 

- Call treeViewObj.SelectItem( rowIndex , 0)

- Call treeViewObj.Clicktem( rowIndex , 0)

 

I also have tried Call rowObj.Click()-> error "The action may be performed incorrectly, because the control is disabled.  There was an attempt to perform an action on a zero -sized window"

 

Attached here is the snapshot of the properties for my row object and my treeview object

  • bbi's avatar
    bbi
    Contributor

    i don't know your project but sometimes data aren't populated till they need to be shown (and it's not a TC problem but coding optimization for faster load).

     

    So you can use the following trick; select your treeview, and use arrows to navigate until accessing the desired item and thus it is displayed and therefore can be accessed.

     

    - Call treeViewObj.SelectItem( 0 , 0)

    - Key down until the desired row index

    - Call treeViewObj.Clicktem( rowIndex , 0)

     

     

    BTW this is more the reality because an user cannot click on invisible item so for testing it's better.

     

  • sanjay0288's avatar
    sanjay0288
    Frequent Contributor

    Hi,

      Spy on the Tree View control and check whether there are any properties like BringIntoView or ScrollIntoView. You can use these properties to scroll to the particular item and click on it.