Hiding an Instance List Column

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
ESODevKJ
Posts: 13
Joined: Tue Nov 10, 2020 9:07 am

Hiding an Instance List Column

Post by ESODevKJ » Tue Nov 10, 2020 9:15 am

I have an instance list where I only need to see 2 columns (only 1 is a visual ID). In the uInitialize section of the Filter, I put the following logic:

Code: Select all

If (#AVLISTMANAGER.avVisualList *IsNot *NULL)
For Each(#Column) In(#AVLISTMANAGER.avVisualList.Columns)

If (#Column.ColumnCaption = 'Name')
#Column.CellMarginRight := 15
#Column.CellWidth := 1000
Else
If (#column.ColumnCaption = 'Customer Account')
#Column.CellWidth := 50
Else
If (#column.ColumnCaption = 'Company')
#column.Visible := False
Endif
Endif
Endif
Endfor
Endif

(The columns aren't changing width either).

Any help would be much appreciated. Thank you.

jyoung
Posts: 690
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Hiding an Instance List Column

Post by jyoung » Wed Nov 11, 2020 1:14 am

Its been a while, but by try setting the ColumnVisible property to false.
Note this is NOT #column.Visible := false, but #column.ColumnVisible := false (super confusing I know. :D)
Also I am doing this by memory so it may not be syntactically correct. ;)

Code: Select all

if (#AVLISTMANAGER.avVisualList *IsNot *NULL)
for each(#column) in(#AVLISTMANAGER.avVisualList.Columns)
#column.ColumnVisible := False
endfor
endif
Hope this helps,
Joe

ESODevKJ
Posts: 13
Joined: Tue Nov 10, 2020 9:07 am

Re: Hiding an Instance List Column

Post by ESODevKJ » Wed Nov 11, 2020 3:45 am

Thanks Joe, this was it. Also led me in the right direction with the column widths. Much appreciated!

Post Reply