Android Question How to select all (check all items in custom listview with checkbox)

mangojack

Well-Known Member
Licensed User
Longtime User
one option .. place another checkbox or button titled "Select All" ... then

B4X:
Sub chkCheckAllItems_CheckedChange(Checked As Boolean)
 
   For i= 0 To clv3.GetSize -1  'CustomListView dimmed as clv3
     Dim pnl As Panel
     pnl = clv3.GetPanel(i)
   
     Dim chk As CheckBox
     chk= pnl.GetView(2)      'presuming checkbox is 3rd view in panel (same as example)
     chk.Checked = True
   Next
 
End Sub
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Error... View Must be initialize...

mangojack wrote:
chk= pnl.GetView(2) 'presuming checkbox is 3rd view in panel (same as example)

if the checkbox has a different "id" (not 2) you must change that 2.

Also, change:
chk.Checked = True

to
chk.Checked = Checked
 
Upvote 0
Top