Forum Discussion

amod_kulkarni's avatar
amod_kulkarni
New Contributor
10 years ago

Checking enabled state of ListView subitems

Hi,



I wish to check enabled/disabled state of specific ListView subitems. I have index of item and subitem to be checked. I could not find a way to do it in TestComplete. Can someone help?



Thanks,

Amod Kulkarni

2 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Amod,

     


    You can try using the wSelected property like in this sample:




    //JScript


    function Test()


    {


      var p, ListView, Item;


     


      p = Sys.Process("ListViewSample");


      ListView = p.Window("MyWndClass", "Form1").Window("SysListView32");


      Item = "Item 5";


     


      if (ListView.wSelected(Item))


        Log.Message("The list view item '" + Item + "' is selected.")


      else


        Log.Message("The list view item '" + Item + "' is not selected.");






     


    Refer to the "Checking List View Items' State" article to learn other ways to accomplish your task.


     

  • Hi Tanya,



    Thanks for your feedback.



    I want to check the enabled/disabled state of item (in other words, whether the item is available for user input or is it readonly). I believe wSelected property checks whether the item is selected in listview or not. So it does not serve the purpose.



    Thanks,

    Amod Kulkarni