adding data to table

Discussion in 'Questions (Windows Mobile)' started by gjoisa, Mar 23, 2009.

  1. gjoisa

    gjoisa Active Member Licensed User

    Hi all !

    I want to fill some data to a table (Not from database or csv ) which consists 2 rows and 82 columns . How to add it ?
     
  2. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    From the help file:

    Adds a new row to a Table.
    Syntax: AddRow ([Value1, Value2,...])
    If the number of values is less than the number of columns, then empty cells will be added.
    Example:
    Table1.AddCol (cNumber, "ID", 50, True)
    Table1.AddCol (cString, "Name", 50)
    Table1.AddRow (234564, "John")


    RBS
     
  3. JesseW

    JesseW Active Member Licensed User

    the above demonstrates how to add new data rows to a table. if you want to change the data in an existing row, use the Table1.Cell("ColName", RowNumver) property. you'll be able to find an example in the desktop ide help file under Table in the Controls section.
     
  4. Kintara

    Kintara Member Licensed User

    Adding the data as a variable

    OK So If I had DATA1$="1,2,3,4,5" is there a way I could add this to a new row in a table.
    obviously
    Table1.Addrow(Data1$) does not work.
    Will I have to break it down to the individual values to addRow?
    i.e.
    Table1.AddRow("1","2","3","4","5")
    Shame as using a variable string is so much less typing!

    Any Ideas?

    Kintara :cool:
     
  5. derez

    derez Expert Licensed User

    you can split the string using splitstr and then use a loop with cell, to assign each cell with its matching string from the list.
     
  6. specci48

    specci48 Well-Known Member Licensed User

    If you could imagine using a listview instead of a table the following code line will work:
    Code:
    data1$ = "1,2,3,4,5"
    lv.AddRow(StrSplit(data1$, 
    ","))
    A sample code is attached...


    specci48
     

    Attached Files:

  7. Kintara

    Kintara Member Licensed User

    OMG - You guys are good!

    Thanks for your replys. I'll be giving them a go, but suspect it will be the split string method. Lists are ook, but I'll be needing to filter it - I'll stick with a table.
    thanks guys.

    Kintara :cool:
     
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