Refresh Browse Column Labels

jdpjamesp

ProgressTalk.com Moderator
Staff member
This seems a little basic, but I can't work it out. I have a freeform query Browse in which I conditionally set the column-label of a number of columns based on the data they hold. Now obviously in the DISPLAY trigger of the browse they have a default column label defined. Does anyone know if there's a method I can apply to the browse that will reset the column labels to this default initial value?

Progress 10.1C on Windows, but needs to work under version 9.1E (we sadly still have customers on this version).
 
Greetings,

Using Progress, this attribute is NOT available to be amended at run time.
You are NOT able to dynamically alter the attribute, meaning it is static value that has to be initialized at design time.
Good luck.
BFN
 
Hi

First you need to save the initial labels of your browse
Put this in definitios:
DEF VAR etiquetas AS CHAR EXTENT 15 NO-UNDO.
DEF VAR celda_br AS WIDGET-HANDLE EXTENT 15 NO-UNDO.
DEF VAR cual_celda AS WIDGET-HANDLE NO-UNDO.
DEF VAR n_cols_browse AS INT NO-UNDO.
DEF VAR col_act AS INT NO-UNDO.

In your main block, after "pause 0 before-hide" put this: (this code saves your initial labels)
DO n_cols_browse = 1 TO browse-1:NUM-COLUMNS.
celda_br[n_cols_browse] = browse-1:GET-BROWSE-COLUMN(n_cols_browse).
cual_celda = celda_br[n_cols_browse].
etiquetas[n_cols_browse] = cual_celda:LABEL.
END.
n_cols_browse = browse-1:NUM-COLUMNS.

Four your example I used 2 buttons
1.- Change the labels (this display 'a','b','c',,,,,,)
DO col_act = 1 TO n_cols_browse.
cual_celda = celda_br[col_act].
cual_celda:LABEL = CHR(col_act + 96).
END.

2.- A second button to restore the initial labels
DO col_act = 1 TO n_cols_browse.
cual_celda = celda_br[col_act].
cual_celda:LABEL = etiquetas[col_act].
END.

It works.

MRobles
 
Greetings,

Using Progress, this attribute is NOT available to be amended at run time.
You are NOT able to dynamically alter the attribute, meaning it is static value that has to be initialized at design time.
Good luck.
BFN

There you are mistaken - you can alter the column label of a browse at run time. We do it all the time.
 
Hi

First you need to save the initial labels of your browse

Thanks for that - it's similar to the solution I came up with. It's just a shame that there isn't an easy procedure call that would do it for you. :)
 
Back
Top