B4J Question Read Data from TableView

Reinierus

Member
Licensed User
Longtime User
Hello.
I need to read the data of the given column number of the TableView. For example, I need to read all rows of column 3 of the TableView.
How can I do that? Someone can help me?

Thanks a lot
 

Roycefer

Well-Known Member
Licensed User
Longtime User
TableViews hold their data in a List of String arrays, each String array representing a row. I haven't tested it but try this:
B4X:
Sub getColumnData(col as int, tv as TableView) as List
     Dim resList as List
     resList.Initialize
     For j = 0 to tv.Items.Size-1
          Dim r() as String = tv.Items.Get(j)
          If r.Length>col Then
               resList.Add(r(col))
          Else
               resList.Add(" ")
          End If
     Next
     Return resList
End Sub
 
Upvote 0
Top