Android Question [B4XTable] How to show and hide record indicator?

vecino

Well-Known Member
Licensed User
Longtime User
Hi, that's what I would like to know, thank you.

comor.png
 
Solution
It should show in the space below the search. Try to change color of its text just in case:
B4XTable1.lblFromTo.TextColor=xui.Color_Magenta
Also try to comment these 2 lines to see if the default values show up
B4X:
tbLecturas.StringTo = "a"
    tbLecturas.StringOutOf = "de"
And also try it in portrait to see if it reappears

vecino

Well-Known Member
Licensed User
Longtime User
Hello, thank you for your help.
Actually the problem I have is that it is not displayed.

posno.png


This is the code:
B4X:
' id numerocontador lecturadescargada nombreregante codigoregante observaciones consumo
Sub CargarDatosTabla
    Dim cSql As String = $"select * from tbLecturas order by numerocontador"$
    '''                contador      lectura       lectura anterior    diferencia            nombre regante
    Private colNUMEROCONTADOR, colCONSUMO, colLECTURADESCARGADA, colCONSUMODIFERENCUA, colNOMBREREGANTE, colCODIGOREGANTE, colOBSERVACIONES, colID As B4XTableColumn
    '
    If tbLecturas.IsInitialized Then
        tbLecturas.Clear
    End If
    '
    colNUMEROCONTADOR            = tbLecturas.AddColumn("Contador",            tbLecturas.COLUMN_TYPE_NUMBERS)
    colCONSUMO            = tbLecturas.AddColumn("Lectura",                tbLecturas.COLUMN_TYPE_NUMBERS)
    colLECTURADESCARGADA    = tbLecturas.AddColumn("Última",                tbLecturas.COLUMN_TYPE_NUMBERS)
    colCONSUMODIFERENCUA    = tbLecturas.AddColumn("Consumo",                tbLecturas.COLUMN_TYPE_NUMBERS)
    colNOMBREREGANTE             = tbLecturas.AddColumn("Regante",                tbLecturas.COLUMN_TYPE_TEXT)
    colCODIGOREGANTE            = tbLecturas.AddColumn("Código",                tbLecturas.COLUMN_TYPE_TEXT)
    colOBSERVACIONES            = tbLecturas.AddColumn("Observaciones",    tbLecturas.COLUMN_TYPE_TEXT)
    colID                                    = tbLecturas.AddColumn("id",                        tbLecturas.COLUMN_TYPE_NUMBERS)
    '
    Dim iAncho As Int = tbLecturas.mBase.Width
    colNUMEROCONTADOR.Width         = iAncho * 0.10
    colCONSUMO.Width                         = iAncho * 0.10
    colLECTURADESCARGADA.Width    = iAncho * 0.10
    colNOMBREREGANTE.Width             = iAncho * 0.30
    colCODIGOREGANTE.Width             = iAncho * 0.10
    colOBSERVACIONES.Width             = iAncho * 0.30
    colID.Width = -1
    '
    Sleep(0)
    tbLecturas.StringTo = "a"
    tbLecturas.StringOutOf = "de"
    tbLecturas.lblFromTo.Visible=True
    '  
    tbLecturas.SearchField.HintText = "Buscar"
    tbLecturas.SearchField.Update  
    '
    For Each tc As B4XTableColumn In Array(colCONSUMO,colLECTURADESCARGADA,colCONSUMODIFERENCUA,colID)
        tc.Searchable = False
    Next
    '      
    Dim lll As List
    lll.Initialize
    Dim rs As ResultSet = globales.DBconex.ExecQuery(cSql)
    Do While rs.NextRow
        Dim row(8) As Object
        '
        row(0) = rs.GetString("numerocontador")
        row(1) = ""
        row(2) = rs.GetLong("lecturadescargada")
        row(3) = ""
        row(4) = rs.GetString("nombreregante")
        row(5) = rs.GetString("codigoregante")
        row(6) = rs.GetString("observaciones")
        row(7) = rs.GetInt("id")
        '
        lll.Add( row )
    Loop
    rs.Close
    tbLecturas.SetData( lll )
    '
    tbLecturas.Refresh
'    tbSearch.SearchField.RequestFocusAndShowKeyboard
End Sub
 

Attachments

  • posno.png
    posno.png
    93.3 KB · Views: 113
Upvote 0

Mahares

Expert
Licensed User
Longtime User
It should show in the space below the search. Try to change color of its text just in case:
B4XTable1.lblFromTo.TextColor=xui.Color_Magenta
Also try to comment these 2 lines to see if the default values show up
B4X:
tbLecturas.StringTo = "a"
    tbLecturas.StringOutOf = "de"
And also try it in portrait to see if it reappears
 
Upvote 2
Solution
Top