Hiding List Columns dynamically

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
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Hiding List Columns dynamically

Post by soa »

I have a list control with several columns that I'd like to show/hide dynamically. I have code like.

Clr_List Named(#lstCourseEnrolments)

#ColumnNUMHRS1.Visible := false
#ColumnYEAR10ASS1.Visible := false
#ColumnYEAR10GRA1.Visible := false
#ColumnYEAR10GRD1.Visible := false

#ColumnSCHLNM_W1.Visible := true
#ColumnUNIHRS1.Visible := true

for

Add_Entry To_List(#lstCourseEnrolments)

endfor

The first time through this seems to work but in subsequent runs setting the first three columns to visible and hiding the last two does not have an effect.

Have I missed something (highly probable)?
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: Hiding List Columns dynamically

Post by MarkDale »

I'm not sure of the environment you are in, but if its something like a #PRIM_LIST column, in VL_web, V14SP1 or later, I found that the ColumnVisible property was better for controlling column visibility.
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: Hiding List Columns dynamically

Post by soa »

Thanks Mark, I 'll give that a try (on Monday).

I'm using VLW 14SP1.
Post Reply