B4J Question go to the primitive records When the record is clicked tabel view

alirezahassan

Active Member
Licensed User
hi,
i have a table view. i want go to the primitive records When the record is clicked tabel view with check box
like this:
To raise selected records, what should i do?
ezgif.com-gif-maker.gif
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
following code assumes that you:
1. the checkbox lives within the rows of the tableview
2. the checkbox tags holds the information of the row index it lives in
B4X:
private Sub checkbox_CheckedChange(Checked As Boolean)
    Dim chk As CheckBox = Sender
    
    Dim index As Int = chk.Tag
    Dim arr() As Object = tw.Items.Get(index)
    
    tw.Items.RemoveAt(index)
    If Checked Then
        tw.Items.InsertAt(0,arr)
    Else
        tw.Items.InsertAt(tw.Items.Size -1,arr)
    End If
End Sub
hope it helps.
 
Upvote 0
Top