You can use IsChecked method to verify whether the first item is checked or not.
Check the following example code from TP Help:
Dim netlstvw As TDotNETListView
Set netlstvw = DotNETListView("Name=lvEmployees")
If netlstvw.IsChecked(1) = True Then
DotNETListView("Name=lvEmployees").SetCheckIndex 2, tpChecked
DotNETListView("Name=lvEmployees").SetCheckIndex 3, tpChecked
UserCheck "firstcheckbox", netlstvw.IsChecked(1), "First check box was NOT checked, stopping."
hi surya and vishu...
thnx a ton for ur help...ur code really helped me, surya..
i was just wondering what makes testpartner test script check 1 item sometimes and check all items other times on encountering same piece of code as below...
<font class="small">Code:</font><hr /><pre>
index = listView1.FindItem(config(2))
' To find an index of newly added item config(2) in list
listView1.SetCheckIndex index, tpChecked
' to check that index
when i print index after 1st line, it sometimes gives zero instead of a non-zero number.In such cases, it simply checks all list items....dont know why...
other times, it works properly and index prints non zero number and checks only the required item...can u throw some light on this..