B4J Question [SOLVED] B4XTable - How to get...

Mahares

Expert
Licensed User
Longtime User
Solved (I hope
Here is another way to get all the columns header views:
B4X:
For Each col As B4XTableColumn In B4XTable1.Columns
        Dim xlbl As B4XView = col.CellsLayouts.Get(0).As(B4XView).GetView(0)   '<------
        xlbl.SetColorAndBorder(xui.Color_Cyan, 4dip, xui.Color_Black, 6dip)
        Log(xlbl.Text)
    Next
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
This way you get the label, I needed the base view. I have yet to try it but I think it should be xlbl.Parent.

P.S. Yes, confirmed.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I think it should be xlbl.Parent.
To get the xlbl.parent, you can do anyone of these three:
B4X:
For Each col As B4XTableColumn In B4XTable1.Columns        
        Dim xlbl As B4XView = col.CellsLayouts.Get(0).As(B4XView).GetView(0)   '<------
        xlbl.parent.SetColorAndBorder(xui.Color_Cyan, 4dip, xui.Color_Black, 6dip)
    Next
or:
B4X:
 For Each col As B4XTableColumn In B4XTable1.Columns
       Dim pnl As B4XView = col.CellsLayouts.Get(0)
        pnl.SetColorAndBorder(xui.Color_Cyan, 4dip, xui.Color_Blue, 6dip)
    Next
or:
B4X:
Dim j As Int
    For Each col As B4XTableColumn In B4XTable1.Columns
        Dim pnl As B4XView = B4XTable1.clvData.GetPanel(j).GetView(0)
        pnl.SetColorAndBorder(xui.Color_Cyan, 4dip, xui.Color_Green, 6dip)
        j= j+1
    Next
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…