Android Question How to load table view in scrowlist

Makumbi

Well-Known Member
Licensed User
Good afternoon i have succeded in creating a table with these records
now my main problem is how to make my records get loaded in an scrowview list please help

B4X:
    Table1.Initialize(Me, "Table1", 5)
    Table1.AddToActivity(Activity, 0, 0dip, 100%x, 50%y)
    Table1.SetHeader(Array As String("Name", "Class", "stream", "Amount","Date"))
    
    cursor1 = SQL1.ExecQuery("SELECT * FROM student")
    
    For i = 0 To cursor1.RowCount - 1
        cursor1.Position = i
        Table1.AddRow(Array As String(cursor1.GetString("Names"), cursor1.GetString("Class"), cursor1.GetString("Stream"), cursor1.GetString("Amount"), cursor1.GetString("Amount")))
    Next
    Table1.SetColumnsWidths(Array As Int(100dip, 50dip, 50dip, 60dip,50dip))
    Activity.AddMenuItem("Jump To 3000", "Jump1")
    Activity.AddMenuItem("Jump To 0", "Jump2")
 

Makumbi

Well-Known Member
Licensed User
What is a scrowview list?
What is Table1?
Table1 is the definition for the table that i have managed to create and the scrowviewlist I want to be able to scroll down the many records that have been populated in my table using the scrow control in the B4a software. But my problem is to include that control so that it can work
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Unfortunately, you don't tell us what kind of object Table1 is.
So, I suppose that it is the Table Class.
Which version of the Table Class do you use, from this thread TableView - Supports tables of any size or from this thread Flexible Table?
The second one is an evolution of the first one. The latest version is 2.26.
Then, the Table is a CustomView, it is based on a ScrollView !
You can add it directly in the Designer.
With the latest versions you can directly load a SQLite database into the Table object.
This is demonstrated in the demo project.
 
Upvote 0
Top