Android Question [SOLVED] Table Column Not hiding

Discussion in 'Android Questions' started by makis_best, Aug 4, 2019.

  1. makis_best

    makis_best Active Member Licensed User

    Hi

    I try to hide a column from a table.
    I use the code below but not working

    Code:
    Sub Globals
        
    'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.
        Public PrefDialog1 As PreferencesDialog
        
    Private ItemTable_ESMMBOM As Table
    End Sub

    Sub All_Items_Sambania(LookingFor As String)
        
    Dim SQlScript As String
        
    Dim Curs1 As Cursor
        ItemTable_ESMMBOM.InitializeTable(
    7Gravity.CENTER, False)
        ItemTable_ESMMBOM.SetHeader(
    Array As String("xxx""xxx""xxx""xxx""xxx""xxx""xxx"))
        ItemTable_ESMMBOM.SetColumnsWidths(
    Array As Int(70dip200dip60dip80dip110dip250dip100dip))
        ItemTable_ESMMBOM.hideCol(
    6)
        ItemTable_ESMMBOM.SortColumn = 
    False
    .....
    .....
    End Sub
     
  2. makis_best

    makis_best Active Member Licensed User

    Anyone?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Which Table class are you using?
     
  4. klaus

    klaus Expert Licensed User

    I suppose you are using the Flexible Table class.
    I tested the hideCol method in the demo project and it works.
    Please post your test project so we could see what exactly you have done.
     
    emexes likes this.
  5. makis_best

    makis_best Active Member Licensed User

    I am Using the

    and all the code is

    Code:
    Sub Globals
        
    'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.
        Private ItemTable_ESMMBOM As Table
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
        All_Items_Sambania(
    "none999")
        
    End Sub

    Sub All_Items_Sambania(LookingFor As String)
        
    Dim SQlScript As String
        
    Dim Curs1 As Cursor
        ItemTable_ESMMBOM.InitializeTable(
    7Gravity.CENTER, False)
        ItemTable_ESMMBOM.SetHeader(
    Array As String("xxxx""xxxx""xxxx""xxxxx""xxxxx""xxxxx""xxxxx"))
        ItemTable_ESMMBOM.SetColumnsWidths(
    Array As Int(70dip200dip60dip80dip110dip250dip100dip))
        ItemTable_ESMMBOM.hideCol(
    6)
        ItemTable_ESMMBOM.SortColumn = 
    False
        SQlScript = 
    $"Select xxxx, xxxx, xxxx, xxxx FROM T1"$
        Starter.LocalSQL.Initialize(
    File.DirRootExternal & "/DroidViewDB/""DVDatabase.db"True)
        Curs1 = Starter.LocalSQL.ExecQuery(SQlScript)
        
    'Log(Curs1.RowCount)
        For ii = 0 To Curs1.RowCount - 1
            Curs1.Position = ii
            ItemTable_ESMMBOM.AddRowAutomaticWidth(
    Array As String(Curs1.GetString("xxxx"), Curs1.GetString("xxxxx"), _
            Curs1.GetString(
    "xxxxx"), """xxxxxxx""", Curs1.GetString("xxxx")))
        
    Next
    End Sub
     
    Last edited: Aug 6, 2019
  6. klaus

    klaus Expert Licensed User

    Move ItemTable_ESMMBOM.hideCol(6) after the For / Next loop.

    Why do you define a table with 7 colums but, you read 4 columns and try to fill 5 columns, strange?

    You define the column widths with SetColumnsWidths and then you use AddRowAutomaticWidth?
    Do you want automatic widths or the predefined widths?

    The Table class has methods to load directly SQLite database query results.
     
    Erel likes this.
  7. makis_best

    makis_best Active Member Licensed User

    I want to have empty columns.

    I want to use SetColumnsWidths the AddRowAutomaticWidth it is my mistake... I didn't notice.

    I din't know that. I check.

    That works.

    Thank you.
     
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