Hello
I have a CLV with a checkbox as a first item
I want to check the check box when i click inside it or when i click in clvItem,
and a checkAll checkbox to select all or Deselect All when i clicked in checkbox/label select All
I have trouble when using both checkBox or clvStudents_ItemClick, I cant set both of them. It seems that the one disable the other.
What i have done until now is the bellow code and works.
Any idea how to make this happen or an other approaching method?
Thank you all
I have a CLV with a checkbox as a first item
I want to check the check box when i click inside it or when i click in clvItem,
and a checkAll checkbox to select all or Deselect All when i clicked in checkbox/label select All
I have trouble when using both checkBox or clvStudents_ItemClick, I cant set both of them. It seems that the one disable the other.
What i have done until now is the bellow code and works.
B4X:
Private chkAllDisable as Boolean
Private Sub clvStudents_ItemClick (Index As Int, Value As Object)
' Do something with Value
' change checkbox
Dim pnl As B4XView = clvStudents.GetPanel(Index)
pnl.GetView(0).Checked = Not(pnl.GetView(0).Checked)
'This is to uncheck chkAll
If chkAll.Checked Then
chkAllDisable = True
chkAll.Checked = False
End If
End Sub
Private Sub chkAbs_CheckedChange(Checked As Boolean)
' I dont know what to do here
End Sub
Private Sub chkAll_CheckedChange(Checked As Boolean)
If Not(chkAllDisable) Then
For i = 0 To clvStudents.Size-1
Dim pnl As B4XView = clvStudents.GetPanel(i)
pnl.GetView(0).Checked = Checked
If Checked Then
' DO something with Value(i)
Else
' DO something with Value(i)
End If
Next
End If
End Sub
Private Sub lblSelectAll_Click
chkAllDisable = False
chkAll.Checked = Not(chkAll.Checked)
chkAll_CheckedChange(chkAll.Checked)
End Sub
Any idea how to make this happen or an other approaching method?
Thank you all