Dear,

Disclaimer: This is v17, but maybe it works also in v15.

Following code set a cell color based upon logic.
I paste it as is in my codebase.
The first method called LBOX_CreateColSelBased,
is a generic one for inserting a column to a listbox on form.... Quite long,
but
in the end there is a call to: LISTBOX INSERT COLUMN() and some following
calls to 
OBJECT SET... and LISTBOX SET... depending on the parameters passed.

The second call fills the column with the logic in the method:
LBF_setAvailColor
The call to LISTBOX SET PROPERTY accepts a formula / method with parameters
as a text string. The variable $colvar_t is just used to get the correct
colname for the
newly created column.
The LBF_setAvailColor just returns the RGB color code for what you want to
present on each row.
I only use the lk background color property.

LBOX_CreateColSelBased
($theListbox;->[OrderRow]AntalOrder;"Antal";30;([SOrderHead]Status<5);"|9H1D";Align
right)
$colvar_t:=$objName+String(colvar+colno-1)
LISTBOX SET PROPERTY(*;"col"+$colvar_t;lk background color
expression;"LBF_setAvailColor([SOrderrad]Artikelnr;[SOrderrad]WareHouse;[SOrderrad]AntalOrder)")

I show a picture of result below... If I succeed...

Best Regards

Magnus Torell

<http://4d.1045681.n5.nabble.com/file/t53585/Sk%C3%A4rmavbild_2019-05-07_kl.png>
 



--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to