T theladygeneral Member Licensed User Longtime User Mar 25, 2018 #1 Hello I have a question, please dont send me to a tutorial, been there done that. I used designer for layout all on one layout clv1 customlistview edtin edittext bntin button lblout label i use AddTextItem to populate clv1 my question is how to get text values out of clv1 for example click on item in clv1 and populate lblout thank you
Hello I have a question, please dont send me to a tutorial, been there done that. I used designer for layout all on one layout clv1 customlistview edtin edittext bntin button lblout label i use AddTextItem to populate clv1 my question is how to get text values out of clv1 for example click on item in clv1 and populate lblout thank you
Erel B4X founder Staff member Licensed User Longtime User Mar 25, 2018 #2 I assume that you are using xCustomListView. Option 1: Set the value parameter in AddTextItem to be the same as the text parameter. And then: Code: Copy Sub CLV_ItemClick (Index As Int, Value As Object) lbl1.Text = Value End Sub Option 2: Code: Copy Sub CLV_ItemClick (Index As Int, Value As Object) lbl1.Text = clv1.GetPanel(Index).GetView(0).Text 'the label is the first (and only) view in the item's panel. End Sub Upvote 0
I assume that you are using xCustomListView. Option 1: Set the value parameter in AddTextItem to be the same as the text parameter. And then: Code: Copy Sub CLV_ItemClick (Index As Int, Value As Object) lbl1.Text = Value End Sub Option 2: Code: Copy Sub CLV_ItemClick (Index As Int, Value As Object) lbl1.Text = clv1.GetPanel(Index).GetView(0).Text 'the label is the first (and only) view in the item's panel. End Sub
T theladygeneral Member Licensed User Longtime User Mar 26, 2018 #3 Thank You, it is not working. i have a very small example file Attachments test.zip test.zip 9.6 KB · Views: 364 Upvote 0
mangojack Expert Licensed User Longtime User Mar 26, 2018 #4 Change this Sub .. you were passing the EditText object as value Code: Copy Sub bntin_Click clv1.AddTextItem(edtin.Text, edtin.Text) 'pass the text property of the EditText ... edtin.Text="" End Sub Upvote 0
Change this Sub .. you were passing the EditText object as value Code: Copy Sub bntin_Click clv1.AddTextItem(edtin.Text, edtin.Text) 'pass the text property of the EditText ... edtin.Text="" End Sub