How to hide a column in a browse?


#1

I have a browse that I want to hide a couple fields on some tabs and then unhide them on one tab.
Can’t seem to find in the help how to do this.
Help please.

Thanks
Viola


#2

I do this is with ?BrowseFeq{PROPLIST:Width, <column number>} = 0

Set it to non-zero to unhide.


#3

If you want to hide some columns in the browse:

In the Window Manager, This.Window.Open Procedure

IF condition THEN ?Browse:1{proplist:width,x}=0.

Where x is the number of the column you want to hide


#4

Thank you for your responses.
I will give these a try.


#5

If you have any listbox formatter active, the above approaches are insufficient. The column number might be altered. I use a field name approach (wrapped up in a template), where I check all columns for a particular fieldname. This is a snippet from generated code in ThisWindow.Reset

ColumnNo = 1
Loop While ?ListOL{Proplist:Exists,ColumnNo}
    Case True
    Of Match(Who(BRWOrdrelinjer.q,?ListOL{Proplist:FieldNo,ColumnNo}),'OrdreLinje:Kalkylelaast2',Match:Nocase)
        If Not Ordre:Kunde2
        ?ListOL{Proplist:Width,ColumnNo}=0
        Else
        ?ListOL{Proplist:Width,ColumnNo}=40 !default width
        End
    Of Match(Who(BRWOrdrelinjer.q,?ListOL{Proplist:FieldNo,ColumnNo}),'OrdreLinje:Pris2',Match:Nocase)
        If Not Ordre:Kunde2
        ?ListOL{Proplist:Width,ColumnNo}=0
        Else
        ?ListOL{Proplist:Width,ColumnNo}=50 !default width
        End
    End
End

#6

Clever solution but the example doesn’t increment ColumnNo. I am sure it was an oversight in copying it here.


#7

Yes, thank you for pointing it out. I just copied the two topmost items of about 30 conditions. Columno is incremented in the bottom.