SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How do you set a listview field text

    I have a listview that has three rows and 4 columns. How do I set a value for something in row2 column 3? I can use the GetItem to get the value from that location, but i cant figure out how to set that value.

  2. #2
    Member
    Join Date
    Oct 2004
    Location
    Detroit, MI
    Posts
    74
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do you set a listview field text

    1) Add reference to script for the c:\windows\system32\comctl32.ocx.

    2) Declare a listview object:

    Dim lv As ListView

    3) Set object application listview

    Set lv = ListView("Index=2").Object

    4) Set value for listview row/column
    if row is currently selected:
    lv.ListItems.Item(lv.SelectedItem.Index).SubItems( 3) = newvalue
    else
    lv.ListItems.Item(2).SubItems(3) = newvalue

  3. #3
    Junior Member
    Join Date
    Jan 2010
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do you set a listview field text

    I see how this is supposed to work I think. When I Set lv = ListView("Index=2").Object it does not appear to be late binding to the listview in the C++ application I am testing with TestPartner. If I add a watch to to lv it doesnt show any properties of the listview. When I try lv.ListItems.Item(2).SubItems(3) = newvalue it says that my object is not set.

    I have done this in VB for controls within my application, but this is the first time I have tried it from TestPartner driving a C++ application.

    Any other suggestions?

  4. #4
    Member
    Join Date
    Oct 2004
    Location
    Detroit, MI
    Posts
    74
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do you set a listview field text

    Sorry, "Index=2" was the name of my listview object. You will need to replace "Index=2" with the actual name of your listview object.

  5. #5
    Junior Member
    Join Date
    Jan 2010
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do you set a listview field text

    Yes I did this. I am sure I set the correct object because I can get basic things off of it - such as row count. But when I try to set the text it says object or with not set ( not the exact error message - dont have it in front of me ). When I do a watch on the object it says it is out of context.

  6. #6
    Member
    Join Date
    Oct 2004
    Location
    Detroit, MI
    Posts
    74
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do you set a listview field text

    The only thing I can think of at this time is to create a property check for you listview and then look at the ActiveX properties on the check's detail tab see what items/subitems are being found by TestPartner.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 04:07 AM.

Copyright BetaSoft Inc.