Forum Discussion

sitasrikanth's avatar
sitasrikanth
Contributor
11 years ago

Verify disabled column's in the List View header..

Hi,



I am working on a list view and has header with column names "Name", "Company", "ID".

and i could access the each header column value using 

objheader.wItem(i)



When customizing the column headers, if i disable "Name" column then 

my header will have "Company" and 'ID" columns visible on listview screen.



The code objheader.wItem(0) still returning the "Name" even the "Name" column not displayed on listview



How can i check column not displayed on listview?



Thanks

Srikanth Sita





















3 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Srikanth,


     


    Try calling TestComplete's Refresh method or the control's special method to update the content of the control:




    var listview=//...


    listview.Refresh();


    var objheader = //...


    var col = objheader.wItem(i);




     

  • Hi,



    My issue is resolved



    By checking the WItemBounds width and height properties.



    lvwObject.wItemBounds(0, i).Height = 0 And

    lvwObject.wItemBounds(0, i).Width = 0 



    (0,i) - 0 as first row is always header and ' i '  is the required column to verify





    Thanks

    Srikanth Sita
  • xiaoyuandlg's avatar
    xiaoyuandlg
    Occasional Contributor
    That's quite interesting a question to me and it helped me a lot on my ListView header question. I am recently new to C# ListView control, though I have the ListView C# Tutorial, it didn't mention much about the details of the ListView header. This question is of great use and insight.