< Back

Document Subject: Change Row colour in a view
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#ViewColumnRowBackgroundColours or http://A555F9/nn.nsf/ByAlias/ViewColumnRowBackgroundColours

Coloured view rows and columns, or colored view rows and columns




To do this first add a new column at the beginning of the row:

Set the flag: "use value as color" and make it hidden.

 

@If(Status="Rejected";

255:0:0:  255:255:255;

Form="";

241:241:128: 1:1:1;
1:1:1)

 

The code above puts rejected lines in white text on red background,

categories in black text on yellowy brown background,

and the rest in black on default background.

 

Colours are put in as background 3 rgb numbers then foreground text colour in 3 rgb numbers.

Some colours:

FIELD Apricot:= 255:155:133;

FIELD Black:= 1:1:1;

FIELD Blue:= 0:0:255;

FIELD Green:= 0:255:0;

FIELD OrangeBurnt:= 255:129:65;

FIELD pink:= 255:193:253;

FIELD Red:= 255:0:0;

FIELD White:= 255:255:255;

FIELD Yellow:= 255:255:0;

FIELD YellowyBrown:= 241:241:128;

 

FIELD RejectBgrd:=red;

 

If you only put one colour in ie 1:1:1, then the background stays the same as the normal row colour, and the number refers to the text colour.

Handy if you are using alternate row colours.

Remember that the help spells colour as color. : )

 

Top Tip:

if you set the colours and colour vars in an early column using FIELD RejectBgrd:=red; then later columns can refer to that value.

eg

@If(Status="Rejected"

RejectBgrd:  white;

Form=""

YellowyBrown: black;
black)

 

Very handy if you are using lots of columns and you want to try different colour schemes, and you don't want to have to change the colours in every column.