Not inside the ScrollView. Only with another view above it.Can I add a header to the list ?
You can get any item's panel with GetPanel. Then you need to know the order of views to get the checkbox with Panel.GetView.
Dim p As Panel = clv.GetPanel(0)
Dim chk As CheckBox = p.GetView(2)
chk.Checked = True
For Each v As View In p.GetViewsRecursively
If v Is CheckBox Then
' what you want here, maybe check tag and enable?
End If
Next
Thank you, you were right, I had to change the index , now it works fine!This means that you have used the wrong index on the panel. The view with index 2 must be a TextBox and you are attempting to cast it as a CheckBox.
You could alternatively do a scan through each view on the panel with something like....
B4X:For Each v As View In p.GetViewsRecursively If v Is CheckBox Then ' what you want here, maybe check tag and enable? End If Next
I've done this snippet on my tablet as I don't have my laptop to hand so it might not be exactly correct but hopefully you get the idea.
Dim index As Int
index = clv3.GetItemFromView(Sender)
Dim p As Panel
p = clv3.GetPanel(index)
Dim lbl As Label
lbl = p.GetView(2)
Msgbox(lbl.Text,"")
What is sender here? GetItemFromView is relevant when you manage an event of one of the inner controls.
Msgbox("Item value: " & clv3.GetValue(index)
Dim index As Int
index = clv3.GetItemFromView(Sender)
Dim AchList As CustomListView
Sub AchList_ItemClick (Position As Int, Value As Object)
Dim index As Int
index = AchList.GetItemFromView(Sender)
Dim p As Panel
p = AchList.GetPanel(index)
Dim lbl As Label
lbl = p.GetView(2)
Msgbox("You clicked on " & lbl.text, "")
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?