Sub Button1_Click
' This line take the button that has been clicked on and works out which CLV item it belongs to.
Dim index As Int = clv2.GetItemFromView(Sender)
'This line then gets the base panel upon which the layout was loaded
Dim pnl As B4XView = clv2.GetPanel(index)
' Get the actuals views (Note: This is hardcoded, it may be better to use GetAllViewsRecursive to find the view.
Dim lbl As B4XView = pnl.GetView(0)
Dim chk As B4XView = pnl.GetView(2)
' Make the changes
lbl.Text = "Clicked!"
'Msgbox("Item value: " & clv2.GetValue(index) & CRLF & "Check value: " & chk.Checked, "")
Dim checkedItems As List
checkedItems.Initialize
For i = 0 To clv2.GetSize - 1
Dim p As B4XView = clv2.GetPanel(i)
Dim chk As B4XView = p.GetView(2)
If chk.Checked Then
checkedItems.Add(clv2.GetValue(i))
End If
Next
Log("Checked items: " & checkedItems)
End Sub