Android Question B4XTable hidden column - SOLVED #7

nibbo

Active Member
Licensed User
Longtime User
Hi

Is there a way to set the visibility of a B4XTable column?
I have found some examples of 'hiding' columns but they just seem to be deleting it; I want the column to exist but not be visible.
Saw another example that suggested setting the Width to zero but it seems to always be set to zero and explicitly setting it did not help.
CalculatedWidth seems to have a value but setting that to zero has no effect either.

Many thanks
 

Magma

Expert
Licensed User
Longtime User
 
Upvote 0

nibbo

Active Member
Licensed User
Longtime User
You can hide it and still able to access the map values.

B4X:
B4XTable1.SetData(Data)
B4XTable1.VisibleColumns.RemoveAt(B4XTable1.VisibleColumns.IndexOf(HiddenColumn))
B4XTable1.Refresh
Thanks but I don't want to remove it I just want to hide it.
 
Upvote 0

nibbo

Active Member
Licensed User
Longtime User
You can change column width to 1 dip..
Thanks; I did find that suggestion but it does not seem to work.
Code::
    Log("Before > Width: " & IDColumn.Width)
    IDColumn.Width = 1dip
    Log("After > Width: " & IDColumn.Width)

Log:
Before > Width: 0
After > Width: 0

But the column is still visible.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
You can have an array with last width had.... if you check here... you will find more things...

last width save at array...
B4X:
Dim cc As B4XTableColumn=B4XTable1.visibleColumns.Get(k)
lastcolwidth(k)=cc.Width   'k is your column, lastcolwidth() an integer array
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Hopefully, @Magma or @aeric took care of your problem, but If you are still looking for a solutio, see my code (it works) in post #5 or Jeffrey's code in post #8 in this thread link:
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
@nibbo
if wanna tell what's the solution
you can use,

1653577009914.png

ps: So the solution will become next of your question and will be easier for members to find it...
 
Upvote 0
Top