Browse Columns

Status
Not open for further replies.

Emma

Member
How can i reference the columns of a browse to change their background colour?

I have the code

ASSIGN 'column':BGCOLOR = 12.

but don't know how to reference 'column'.

Any ideas?

TIA,

Emma.
 

Samj

Member
Emma

DEFINE VARIABLE wh-browse AS HANDLE.
DEFINE VARIABLE wh-column AS HANDLE.

ASSIGN
wh-browse = BROWSE BROWSE-1:HANDLE
wh-column = BROWSE BROWSE-1:FIRST-COLUMN.

DO WHILE wh-column <> ?:
ASSIGN
wh-column = wh-browse:NEXT-COLUMN.
IF wh-column:NAME = "whatever" THEN
DO:
ASSIGN
wh-column:BGCOLOR = 12.
LEAVE.
END.
END.

Good Luck
 

Emma

Member
Re: Emma

Originally posted by Samj
DEFINE VARIABLE wh-browse AS HANDLE.
DEFINE VARIABLE wh-column AS HANDLE.

ASSIGN
wh-browse = BROWSE BROWSE-1:HANDLE
wh-column = BROWSE BROWSE-1:FIRST-COLUMN.

DO WHILE wh-column <> ?:
ASSIGN
wh-column = wh-browse:NEXT-COLUMN.
IF wh-column:NAME = "whatever" THEN
DO:
ASSIGN
wh-column:BGCOLOR = 12.
LEAVE.
END.
END.

Good Luck

the program is saying that FIRST-COLUMN and NEXT-COLUMN are not queryable attributes for browse-14? What have i done wrong?
 

Samj

Member
Emma

Sorry.

The browse and it's columns need to be READ-ONLY = FALSE. You can reassign them READ-ONLY = TRUE afterwards if you need to.

Also,

ASSIGN
wh-column = wh-column:NEXT-COLUMN.

Again, sorry.
 

Emma

Member
Re: Emma

Originally posted by Samj
Sorry.

The browse and it's columns need to be READ-ONLY = FALSE. You can reassign them READ-ONLY = TRUE afterwards if you need to.

Also,

ASSIGN
wh-column = wh-column:NEXT-COLUMN.

Again, sorry.

where is the best place to put this code? when i use it within row display, it complains. When i use it within value changed,it first of all says that it is an invalid widget handle and that it has not been initialised or that it has been deleted, then that it cannnot access bgcolour because the handle has been deleted, then when i leave that row, it is red. is there any way i can just alter the colour of all the rows that are flagged as deleted when i enter the program? You can't see that a row has been deleted until after you have left the row.:confused:
 

M-HT

Member
Emma

you could also use this in row-display -
ASSIGN
variablename:BGCOLOR IN BROWSE {&BROWSE-NAME} = color
...
.
for each variable you're displaying in the browse.
 
Status
Not open for further replies.
Top