GridColumn Class Properties

In this section, we discuss each GridColumn class property.

Description

This property specifies whether the fields in the column are enabled (that is, can be edited) or if they are "disabled", that is, un-editable. All columns are enabled by default.

Note: For an analytic grid column, the Enabled property only works with cubes, not dimensions.

This property is read/write.

Example

If Not &ValidID Then 
   &MYGRID = GetGrid(PAGE.EMPLOYEE_CHECKLIST, "EMPL_GRID");
   &MYGRIDCOLUMN = &MYGRID.GetColumn("CHECKLIST_ITEMCODE");
   &MYGRIDCOLUMN.Enabled = False;
End-If;

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

Description

This property specifies the display label for the GridColumn object , as distinct from the grid column’s Record Field Name or Page Field Name. This property overrides the equivalent settings on the Label tab of the grid column’s Page Field Properties.

Note: You can't use this property to set labels longer than 100 characters. If you try to set a label of more than 100 characters, the label is truncated to 100 characters. If you change the column label, then change the field label, you may overwrite the column label with the field label. The grid object is part of a page, not the data buffers, while the field is part of the data buffers. To avoid this problem, always put any changes to column labels in the Activate event. This way the label is set every time the page is accessed.

This property is read/write.

Example

&MYGRIDCOLUMN.Label = "Checklist Item";

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

Description

This property returns the name of the grid column, as a string. This value comes from the Page Field Name on the General tab in the Page Field Properties of the GridColumn object executing the property. This property was the value used to instantiate the GridColumn object.

This property is read-only.

Example

&PF_NAME = &MYGRIDCOLUMN.Name;

Description

Use this property to return a Boolean value indicating whether the grid column field is row a header.

This property is read-only.

Example

Local Grid &MYGRID;
Local GridColumn &MYGRIDTYPECOLUMN;

&MYGRID = GetGrid(Page.QE_GRID_API, "QE_ABSENCE_HIST");
&MYGRIDTYPECOLUMN = &MYGRID.GetColumn("QE_ABSENCE_TYPE");
If (&MYGRIDTYPECOLUMN.RowHeader) Then
   WinMessage("QE_ABSENCE_TYPE is a row header.");
Else
   WinMessage("QE_ABSENCE_TYPE is not a row header.");
End-If;

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.