B4J Question Read Data from TableView

Discussion in 'B4J Questions' started by Reinierus, Jul 1, 2015.

  1. Reinierus

    Reinierus Member Licensed 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
     
  2. Roycefer

    Roycefer Well-Known Member Licensed 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:
    Code:
    Sub getColumnData(col as int, tv as TableViewas 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
     
    Erel likes this.
  3. Reinierus

    Reinierus Member Licensed User

    Thanks Roycefer, I will try it.

    Best Regards
     
  4. Reinierus

    Reinierus Member Licensed User

    It works.

    Thanks a lot
     
  5. Roycefer

    Roycefer Well-Known Member Licensed User

    Glad to hear it.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice