Hello Friends,
This is the smallest and the simplest project I want to share with you . But, forgive me, I can't just resist myself to share the very simple solution I got (thinking 3/4 days ), with you
I forgot to mention, this small sample was created from tips by Master Roberto Lopez. Thank you master
I want to change DynamicForeColor of a Column of a Grid depending on the value of another column of the same grid.
Here is the source code
With best regards.
Sudip
DynamicColor of one Column depending on other Column
Moderator: Rathinagiri
DynamicColor of one Column depending on other Column
Last edited by sudip on Thu Jan 14, 2010 5:15 pm, edited 1 time in total.
With best regards,
Sudip
Sudip
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: DynamicColor of one Column depending on other Column
Hi Sudip,
Thanks for sharing.
Thanks for sharing.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: DynamicColor of one Column depending on other Column
If you are trying to change the forecolor for column 2 based on column 2 content:sudip wrote:Hello Friends,
This is the smallest and the simplest project I want to share with you . But, forgive me, I can't just resist myself to share the very simple solution I got (thinking 3/4 days ), with you
I want to change DynamicForeColor of a Column of a Grid depending on the value of another column of the same grid. Here is the source code With best regards.
Sudip
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
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
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: DynamicColor of one Column depending on other Column
Hello Master Roberto,
Thanks a lot for checking this small sample and for your tips
My original sample was also built on your tips
Thank you again.
Rahi, it's the beauty of HMGForum that creator of very small things (like me), also encouraged to do better Thank you
If someone asks me what is the best thing of Clipper and Harbour, I will say, "Code Block". But, unfortunately I am not very easy with it
With best regards.
Sudip
Thanks a lot for checking this small sample and for your tips
My original sample was also built on your tips
Thank you again.
Rahi, it's the beauty of HMGForum that creator of very small things (like me), also encouraged to do better Thank you
If someone asks me what is the best thing of Clipper and Harbour, I will say, "Code Block". But, unfortunately I am not very easy with it
With best regards.
Sudip
With best regards,
Sudip
Sudip