1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Bold numeric column in B4XTable [Solved]

Discussion in 'Android Questions' started by Francisco Gonzalez 1962, Aug 20, 2019.

  1. Francisco Gonzalez 1962

    Francisco Gonzalez 1962 Member Licensed User

    Hello, I have a numeric 2D array displayed by a B4XTable. I want to show the data in the first column as Bold type. Please can you give me a hint?
    Cheers
    Francisco
     
  2. mangojack

    mangojack Well-Known Member Licensed User

    try this ..
    Code:
    B4XTable1.MaximumRowsPerPage = 20
    B4XTable1.BuildLayoutsCache(
    20)  
    SetColumnBold(
    "Name")
      
    Sub SetColumnBold(columnID As String)
        
    Dim fnt As B4XFont = xui.CreateDefaultBoldFont(16)
        
    Dim column As B4XTableColumn = B4XTable1.GetColumn(columnID)
        
    For i = 1 To column.CellsLayouts.Size - 1        'starts at 1 due to header
            Dim pnl As B4XView = column.CellsLayouts.Get(i)
            pnl.GetView(
    0).Font = fnt
        
    Next
    End Sub
    Anything more than this , you might want to study sub CreateCustomFormat in the Table example
    B4XTable example ...
     
    Francisco Gonzalez 1962 and Erel like this.
  3. Francisco Gonzalez 1962

    Francisco Gonzalez 1962 Member Licensed User

    Thanks for your help!
    It works for small tables, but I found that when using the code and if the table is bigger (100 * 100 elements (double)) the program hangs and exits with an exception. I'll try to post an example later
    Cheers
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    The code above is correct and the table size doesn't matter. In debug mode, filling a large table can be slow when the code is "dirty". Clean it (Ctrl + P) and it will be fast.
     
  5. Francisco Gonzalez 1962

    Francisco Gonzalez 1962 Member Licensed User

    Thanks a lot for your help!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice