Any suggestion on what object i should use to show some data (16 Rows) in a table like view.
I must be able to change values in the tables data cells.
And i want to be able to sort the table rows by code. Say; sort due to the values in cell 2 of each row
Any hints or tips regarding any tutorial?
Actually i´m using a TableView
and later i do updates in this table like this
No i want to be able to sort the table by the values of Row(1)
Any ideas?
I must be able to change values in the tables data cells.
And i want to be able to sort the table rows by code. Say; sort due to the values in cell 2 of each row
Any hints or tips regarding any tutorial?
Actually i´m using a TableView
B4X:
For i = 0 To 15
' WorldPosition(3) As Short
' - CurrentLapDistance As Short
' - RacePosition As Byte
' - LapsCompleted As Byte
' - CurrentLap As Byte
' - Sector As Byte
' - LastSectorTime As Float
If drivers.Name(i).Trim <> "" Then
Dim r As Int = Rnd(0,9)
' table.SetColumns(Array As String("Fahrer", "Position", "CurrentLap","Compl.","Last LapTime"))
table.Items.Add(Array As Object(akt.Get("Driver"), akt.Get("RacePosition"), akt.Get("CurrentLap"),akt.Get("LapsCompleted"),akt.Get("LastSectorTime")))
End If
Next
and later i do updates in this table like this
B4X:
Dim t As Telemetry = ParseTelemetry(raf, Packet.Data)
'driverinfo.Text = driverinfo.Text&CRLF&"PacketType: "&t.PacketType
'driverinfo.Text = driverinfo.Text&CRLF&"BuildVersionNumber: "&t.BuildVersionNumber
'driverinfo.Text = driverinfo.Text&CRLF&"Speed: "&t.Speed
Dim drlist() As ParticipantInfo = t.Driver
For i = 0 To Min(drlist.Length-1,table.Items.Size-1)
Dim pinfo As ParticipantInfo = drlist(i)
If i < table.Items.Size Then
Dim Row() As Object = table.Items.Get(i)
Row(1) = pinfo.RacePosition
Row(2) = pinfo.CurrentLap
Row(3) = pinfo.LapsCompleted
Row(4) = pinfo.LastSectorTime
table.Items.Set(i,Row)
'Log(Row(0))
End If
'driverinfo.Text = driverinfo.Text&CRLF&"CurrentLap("&i&"): "&pinfo.CurrentLap
Next
No i want to be able to sort the table by the values of Row(1)
Any ideas?