Visible property: GridColumn class

Description

This property specifies whether a grid column is visible or hidden. Set this property to False to hide the grid column, and to True to unhide the grid column. This property defaults to True.

The Visible property also hides grid columns that are displayed as tabs in the PeopleSoft Pure Internet Architecture.

If you specify "Show Column on Hide Rows" in Application Designer, the column headers and labels of a grid display at runtime, even when the rest of the column is hidden. You can't override this value using PeopleCode.

Note:

For an analytic grid column, this property is only valid if the column is bound to a dimension on a slicer, and bound to a cube that is on the column axis.

This property is read/write.

Note:

In previous releases of PeopleTools, the methodology for hiding a grid column was to use the Hide function in a loop to hide each cell in the column, one row at a time. This method of hiding grid columns still works. However, your application will experience deteriorated performance if you continue to use this method.

Example

&MYGRIDCOLUMN.Visible = False;

The following example checks for the value of a field in every row of the grid. If that value is "N" for every row, the column is hidden.

&RS = GetRowset(Scroll.EX_SHEET_LINE);
&HIDE = True;
While (&HIDE)

   For &I = 1 To &RS.ActiveRowCount;
      &OUT_OF_POLICY = &RS(&I).EX_SHEET_LINE.OUT_OF_POLICY.Value;
      &NO_RECEIPT_FLG = &RS(&I).EX_SHEET_LINE.NO_RECEIPT_FLG.Value;
      If &OUT_OF_POLICY = "Y" Then
         &OUT_OF_POLICY_HIDE = False;
         &HIDE = False;
      End-If;

      If &NO_RECEIPT_FLG = "Y" Then
         &NO_RECEIPT_HIDE = False;
         &HIDE = False;
      End-If;
   End-For;

   If &HIDE = True Then
      &HIDE = False;
   End-If;

End-While;

If Not (&OUT_OF_POLICY_HIDE) Then
   GetGrid(Page.EX_SHEET_LINE_APV1, "EX_SHEET_LINE").OUT_OF_POLICY.Visible = True;
Else
   GetGrid(Page.EX_SHEET_LINE_APV1, "EX_SHEET_LINE").OUT_OF_POLICY.Visible = False;
End-If;

If Not (&NO_RECEIPT_HIDE) Then
   GetGrid(Page.EX_SHEET_LINE_APV1, "EX_SHEET_LINE").NO_RECEIPT_FLG.Visible = True;
Else
   GetGrid(Page.EX_SHEET_LINE_APV1, "EX_SHEET_LINE").NO_RECEIPT_FLG.Visible =⇒
 False;
End-If;

The ShowColumns and SetProperties methods of the Grid class can provide a noticeable performance improvement over multiple calls to set the Visible property of the GridColumn class.