SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2002
    Location
    ca
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Selecting an item in a treeview that is currently not in view...

    Here's my problem. I have a treeview with at least 100 child objects. I have expanded the tree. The problem is if I want to select an item that is not completely in view. Here's the picture...

    Tree1
    |_Child1
    :
    .
    |_Child 100

    What's only viewable in the application is the first 40 objects in the tree? Now, what if I want to select the 41st or the 50th object, how do I go about this? I tried doing an ExposeItem() but that didn't work. Does anyone have any other suggestions how to approach this problem?

    ------------------

  2. #2
    Senior Member
    Join Date
    Dec 1999
    Location
    Sarasota FL USA
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Selecting an item in a treeview that is currently not in view...

    We have run into several problems with the Treeview in selecting items in the list that are not displayed. What we did was to use the built in process of the select, and had a fall back process if that did not work. Our workaround did the following:

    1) Expand all items in the tree
    2) Get the contents of the tree
    3) Do a list find on the contents to get the index of the item we are looking for
    4) Get the index of the item the cursor is currently on
    5) Use page up / down to make sure the item we are looking for is in view
    6) Select the item by index.

    This is a lot of work and I would only suggest using if no other process works. Another thing I have found in working with tree views. If the item you are looking for in the tree view is not fully displayed then the selection will not always work. In our application we had to expand the width of the tree view to a pre-set max to make sure all of the items could be read (left to right) without scrolling.

    Help this helps.

    ------------------

  3. #3
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Selecting an item in a treeview that is currently not in view...

    I ran into this problem with a treeview control that didnt want to play nice. What I did was run a check like this

    Its scrolls a page until the item you want is visible then selects it. Kind of like above but a different style.

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com
    Ryan McCullough
    RightNow Tech. Inc.

  4. #4
    Member
    Join Date
    Dec 1999
    Location
    Rochester, NY, USA
    Posts
    52
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Selecting an item in a treeview that is currently not in view...

    I typically solve this problem by temporarily setting the Agent options OPT_SHOW_OUT_OF_VIEW and OPT_SCROLL_INTO_VIEW to TRUE. SilkTest handles all the necessary action quite smoothly. It seems to be necessary to have both set in order to enable this.
    Andy Bachman

  5. #5
    Junior Member
    Join Date
    Feb 2001
    Location
    Andover, MA, USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Selecting an item in a treeview that is currently not in view...

    I've also seen this problem. It seems to me that Silktest has no problem selecting the item (even if it's not in view) if the item is higher on the list than what is currently being viewed. So if you're looking at the last item in the list, it never has a problem.

    The way I think I solved it was to:
    Expand the list,
    Select the first item in the list,
    Send the End key (should select the last item in the list)
    Then use your Select.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:10 AM.

Copyright BetaSoft Inc.