B4J Question Row tableview

Tata Mapassa

Active Member
Licensed User
Longtime User
Hello, I have a tableview with the following fields: "Name", "Status". I want all rows with the value "OK" in the "Status" field to be red. Thank you for your help.
 

BlueVision

Well-Known Member
Licensed User
Longtime User
If you are talking about a B4XTable, hope this will do it for you...
Of course you can make use of the standard colours for the XUI statement. I personally prefer the ARGB variants.
The code was taken from a program I use and modified before pasting here. So there might some syntax errors in here I did forgot to correct.

B4X:
Sub B4XTable1_DataUpdated
    For Each c As B4XTableColumn In B4XTable1.Columns
        If c.Id= "Name" or "Status" Then
            For i = 1 To c.CellsLayouts.Size - 1
                Dim pnl As B4XView = c.CellsLayouts.Get(i)
                Dim lbl As B4XView = pnl.GetView(0)
                lbl.TextColor = XUI.Color_ARGB(255,0,0,0)
                If lbl.Text.Contains("OK") Then
                    lbl.TextColor = XUI.Color_ARGB(255,255,0,0)
                End If
            Next
        End If
    Next
End Sub
 
Last edited:
Upvote 0
Top