2

I have a grid where one column is a column of hyperlinks. How can I set the field labels to display the field's value, while keeping the column's label fixed?

1 Answers1

1

You do this in two steps

  1. set the Grid Column Label
  2. For each row in the grid assign a value to the label of the field associated with the button

Ensure on the page that you have set the page field value for the grid and for the hyperlink column

The example below assumes the field associated with the hyperlink is SELECT_BTN. The column heading will be set to "My Column Title" and the hyperlink on the button will be set to the value of the DESCR field on same record.

Local Grid &grid;
Local GridColumn &hyperlinkColumn;
Local integer &i;
Local Rowset &rowset;

/* set the column header */
&grid = GetGrid(%Page, "MYRECORD");
&hyperlinkColumn = &grid.GetColumn("SELECT_BTN");
&hyperlinkColumn.Label = "My Column Title";

&rowset = GetLevel0()(1).GetRowset(Scroll.SOMERECORD);

/* Set the value for each hyperlink in the rowset */
For &i = 1 To &rowset.ActiveRowCount
   &rowset(&i).SOMERECORD.SELECT_BTN.Label = &rowset(&i).SOMERECORD.DESCR.Value;
End-For;
Darryls99
  • 921
  • 6
  • 11