sudip wrote:Hello Friends,
This is the smallest and the simplest project I want to share with you
![Wink ;)](./images/smilies/icon_e_wink.gif)
. But, forgive me, I can't just resist myself to share the very simple solution I got (thinking 3/4 days
![Laughing :lol:](./images/smilies/icon_lol.gif)
), with you
I want to change DynamicForeColor of a Column of a Grid depending on the value of another column of the same grid.
DynColor.jpg
Here is the source code
DynamicColor.zip
With best regards.
Sudip
If you are trying to change the forecolor for column 2 based on column 2 content:
Please, replace your DynColor function with this:
Code: Select all
Function DynColor(mRow, mCol)
local r
if mCol == 2
if frmAtten.grdAtten.cell(mRow, 2) = 1
r := {0, 0, 0}
else
r := {0, 255, 0}
endif
else
r := {0, 0, 0}
endif
return r
If you are trying to change the forecolor for column 1 based on column 2 content:
Please, replace your DynColor function with this:
Code: Select all
Function DynColor(mRow, mCol)
local r
if mCol == 1
if frmAtten.grdAtten.cell(mRow, 2) = 1
r := {0, 0, 0}
else
r := {0, 255, 0}
endif
else
r := {0, 0, 0}
endif
return r