I have this field in a B4XTable:
COLUMN = TBLTRAD.AddColumn("BESTNUMBERS",TBLTRAD.COLUMN_TYPE_TEXT)
CreateCustomFormat(COLUMN)
SetColumnAlignment("BESTNUMBERS",Gravity.LEFT)
This column (BESTNUMBER) fetchs several number. I don't know if it's possible to change color to a mayor value inside there
I'm trying with a Erel's example this
Here I'm trying to fetch the best number and change its color but I don't know how to implement this or if it's possible
I need to change only the color in that value. Not the whole row color but the value color. Thank you in Advance.
COLUMN = TBLTRAD.AddColumn("BESTNUMBERS",TBLTRAD.COLUMN_TYPE_TEXT)
CreateCustomFormat(COLUMN)
SetColumnAlignment("BESTNUMBERS",Gravity.LEFT)
This column (BESTNUMBER) fetchs several number. I don't know if it's possible to change color to a mayor value inside there
I'm trying with a Erel's example this
Here I'm trying to fetch the best number and change its color but I don't know how to implement this or if it's possible
B4X:
Private Sub CreateCustomFormat (c As B4XTableColumn)
Dim formatter As B4XFormatter
formatter.Initialize
c.Formatter = formatter
c.Width = 90
Dim Positive As B4XFormatData = c.Formatter.NewFormatData
Dim QRY As String
Dim num As Int
QRY = "SELECT MAX(allnumbers) FROM table1"
ops.Initialize
num =ops.SQL1.ExecQuerySingleResult(QRY)
Log("BETTER NUMBER: " &num)
....here it would be the right code
Positive.TextColor =xui.Color_Red
Positive.FormatFont = xui.CreateDefaultBoldFont(4)
Positive.FormatFont = xui.CreateDefaultFont(20)
c.Formatter.AddFormatData(Positive, 0, c.Formatter.MAX_VALUE, True) 'Inclusive (zero included)
Dim Negative As B4XFormatData = c.Formatter.CopyFormatData(Positive)
Negative.TextColor = xui.Color_Red
Negative.FormatFont = xui.CreateDefaultBoldFont(16)
Negative.Prefix = "("
Negative.Postfix = ")"
c.Formatter.AddFormatData(Negative,c.Formatter.MIN_VALUE, 0, False)
End Sub
I need to change only the color in that value. Not the whole row color but the value color. Thank you in Advance.