Android Question Sample code for Updaterow() from Table Class

Discussion in 'Android Questions' started by slavko, Jun 30, 2015.

  1. slavko

    slavko Member Licensed User

    Hi,

    i am trying to find any kind of sample for UpdateRow from Table class. Through the Search i got only 3 matches, that i can find out, what a proper sintax is.

    What i am trying to do , is, to update a table created from csv and than save back to file.

    Are there any samples?

    THX, Slavko
     
  2. klaus

    klaus Expert Licensed User

    You need to define an array of the column values and call UpdateRow.
    Code:
    Dim Values() As String
    Values = 
    Array As String (ValCol1, ValCol2, etc)
    Table1.UpdateRow(RowIndex, Values)
     
  3. slavko

    slavko Member Licensed User


    it is working now, thx, Slavko
     
  4. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    How can I update only one cell, since it updates an entire row
     
  5. klaus

    klaus Expert Licensed User

    Three possibilities:
    1. define a string array with all the values in the row with the new value for the given col.

    2. Add this routine in the class code.
    Code:
    ' update a cell in the table
    ' col is the columne index and row is the row index of the cell to update, Value is the cell content string
    ' return true if worked out, false if failed
    Public Sub UpdateCell(Col As Int, Row As Int, Value As StringAs Boolean
        
    If (Col < 0 Or Col > mNumberOfColumns - 1 Or Row < 0 Or Row>Data.Size-1Then
            
    Return False
        
    End If
        SetValue(Col, Row, Value)
        
    Return True
    End Sub
    3. Download version 2.25, which contains the UpdateCell routine.
     
    Johan Hormaza likes this.
  6. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Thanks KLAUS!!!:)
     
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