Android Question Make Text Bold For Particular Columns of Two Rows

Sub B4XTable1_DataUpdated
For i = 0 To B4XTable1.VisibleRowIds.Size - 1
Dim pnl As B4XView = c1.CellsLayouts.Get(i+1)
If pnl.GetView(c1.LabelIndex).Text="Total" Then
' If pnl.GetView(c1.LabelIndex).Text.Contains("Total") Then
pnl.GetView(c1.LabelIndex).Font = xui.CreateDefaultBoldFont(32)
Else
pnl.GetView(c1.LabelIndex).Font = xui.CreateDefaultFont(16)
End If
Next
End Sub


Can I Make text As Bold for particular columns of two rows using above code snippet?
 

Mahares

Expert
Licensed User
Longtime User
Can I Make text As Bold for particular columns of two rows
1. You were asked to use code tags. You can still edit your code in post 1 to make it with tags. It will look a lot more professional.
2. I am not sure your question is clear, but based on my understanding of it here is my code and screenshot. If not, please post a snapshot of your table showing what you want to bold and explain better:
B4X:
Sub B4XTable1_DataUpdated    'Col 1 and Col2 are the names of the 2 columns I am interested in
    For i = 0 To B4XTable1.VisibleRowIds.Size - 1
        For Each c As B4XTableColumn In Array (B4XTable1.GetColumn("Col 1"), B4XTable1.GetColumn("Col 2"))
            Dim pnl As B4XView = c.CellsLayouts.Get(i+1)
            If pnl.GetView(c.LabelIndex).Text="Total" Or pnl.GetView(c.LabelIndex).Text="99" Then
                pnl.GetView(c.LabelIndex).Font = xui.CreateDefaultBoldFont(32)
            Else
                pnl.GetView(c.LabelIndex).Font = xui.CreateDefaultFont(16)
            End If
        Next
    Next
End Sub
1695292327057.png
 
Upvote 1
Top