Forecolor in grid displays the records alternating color
Moderator: Rathinagiri
Forecolor in grid displays the records alternating color
Hi,
In a control grid (image attached, please take a look), the records are displayed alternating color, but how to implement that negative numbers are displayed in red, without losing the background color of alternating
Can someone please give me an advice about this implementation.
Thanks.
Best Regards
Javier
In a control grid (image attached, please take a look), the records are displayed alternating color, but how to implement that negative numbers are displayed in red, without losing the background color of alternating
Can someone please give me an advice about this implementation.
Thanks.
Best Regards
Javier
- Attachments
-
- img1.png (6.63 KiB) Viewed 4315 times
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Forecolor in grid displays the records alternating color
jparada wrote:Hi,
In a control grid (image attached, please take a look), the records are displayed alternating color, but how to implement that negative numbers are displayed in red, without losing the background color of alternating
Can someone please give me an advice about this implementation.
Thanks.
Best Regards
Javier
Code: Select all
English:
--------
Bug Reports:
Submit them to the bug report section according the following rules:
The bug report MUST include a DETAILED DESCRIPTION of the problem AND a simple
CODE SAMPLE (including all necessary files to get it run) showing it.
Besides that, you MUST indicate Windows and HMG versions used.
Español:
--------
Reportes de Bugs:
Por favor, enviarlos a la sección 'Bugs' del foro de acuerdo a las siguientes reglas:
El reporte DEBE incluir una DESCRIPCION DETALLADA del problema y un ejemplo simple que permita verificarlo incluyendo todos los archivos necesarios para poder compilarlo y ejecutarlo.
Además debe indicarse la versión de Windows y HMG utilizadas.Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Forecolor in grid displays the records alternating color
Hi,
Roberto Thanks for answering, but unfortunately I do not understand your answer.
Here I am asking for something I do not know how to do it, I'm not reporting a bug, or maybe I do not understand the context of your response or maybe I was not very clear to my question.
Please let me know if my question I did not properly.
PS: Actually I'm wrong, I said a Grid control when I'm trying to do with a Browse control
Thanks
Best Regards
Javier
Roberto Thanks for answering, but unfortunately I do not understand your answer.
Here I am asking for something I do not know how to do it, I'm not reporting a bug, or maybe I do not understand the context of your response or maybe I was not very clear to my question.
Please let me know if my question I did not properly.
PS: Actually I'm wrong, I said a Grid control when I'm trying to do with a Browse control
Thanks
Best Regards
Javier
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Forecolor in grid displays the records alternating color
Sorry, I've misunderstood your message.jparada wrote:Hi,
Roberto Thanks for answering, but unfortunately I do not understand your answer.
Here I am asking for something I do not know how to do it, I'm not reporting a bug, or maybe I do not understand the context of your response or maybe I was not very clear to my question.
Please let me know if my question I did not properly.
PS: Actually I'm wrong, I said a Grid control when I'm trying to do with a Browse control
Thanks
Best Regards
Javier
Look at the samples using DynamicForecolor.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Forecolor in grid displays the records alternating color
Hi,
Why if I do something like this:
This does not work.
And if I add a variable and do something like this:
Then if it works, But I think it is not the right way, what do you think?.
Please any tip to do it the right way.
Thanks.
Best Regards
Javier
Why if I do something like this:
Code: Select all
PRIVATE bckColor := { || If( OrdKeyNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) }
PRIVATE bckFore := { || If( OrdKeyNo() % 2 == 0, { 0,0,0 } , { 0,0,0 } ) }
FIELDS { "f_cve_art", "f_nomb_art", "Transform(g_existotal := ExistActual('01', Articulos->f_cve_art),'9999')" } ;
DYNAMICBACKCOLOR { bckColor, bckColor, bckColor } ;
DYNAMICFORECOLOR { bckFore , bckFore , If( g_existotal < 0, { 255,0,0 }, bckFore) } ;And if I add a variable and do something like this:
Code: Select all
PRIVATE bckColor := { || If( OrdKeyNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) }
PRIVATE bckFore := { || If( OrdKeyNo() % 2 == 0, { 0,0,0 } , { 0,0,0 } ) }
PRIVATE _bckFore := { || If( g_existotal < 0, { 255,0,0 } , { 0,0,0 } ) }
FIELDS { "f_cve_art", "f_nomb_art", "Transform(g_existotal := ExistActual('01', Articulos->f_cve_art),'9999')" } ;
DYNAMICBACKCOLOR { bckColor, bckColor, bckColor } ;
DYNAMICFORECOLOR { bckFore , bckFore , _bckFore) } ;Please any tip to do it the right way.
Thanks.
Best Regards
Javier
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Forecolor in grid displays the records alternating color
Please, change it by:jparada wrote:Hi,
Why if I do something like this:This does not work.Code: Select all
DYNAMICFORECOLOR { bckFore , bckFore , If( g_existotal < 0, { 255,0,0 }, bckFore) } ;
Code: Select all
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255,0,0 } } , bckFore) } ;Please, in the future, when something do not work for you, please post a small complete sample showing the problem.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Forecolor in grid displays the records alternating color
Hi,
Thanks
Best Regards
Javier
This works finePlease, change it by:
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255,0,0 } } , bckFore) } ;
I am sorry for the inconvenience.It is difficult to assure that your program will work with only small chunks of code as analysis basis, but...
Please, in the future, when something do not work for you, please post a small complete sample showing the problem.
Thanks
Best Regards
Javier
Re: Forecolor in grid displays the records alternating color
Hi,
After getting that negative numbers are deployed with the color red (Thanks again Roberto).
Now I also like to do the same with DynamicBackColor property, and I try to do exactly as I do with the property DynamicForeColor, but I could not do it.
I attached image about the error that I am getting, please take a look, and also attach a small example, please take a look too.
Please can someone tell me how to fix it?
Thanks
Best Regards
Javier
After getting that negative numbers are deployed with the color red (Thanks again Roberto).
Now I also like to do the same with DynamicBackColor property, and I try to do exactly as I do with the property DynamicForeColor, but I could not do it.
I attached image about the error that I am getting, please take a look, and also attach a small example, please take a look too.
Please can someone tell me how to fix it?
Thanks
Best Regards
Javier
- Attachments
-
- test.zip
- (2.87 KiB) Downloaded 215 times
-
- img.png (30.41 KiB) Viewed 4228 times
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Forecolor in grid displays the records alternating color
Hi Javier,
Change the two lines (33,34) with this...
Change the two lines (33,34) with this...
Code: Select all
DYNAMICBACKCOLOR { bckColor, bckColor, { || If( g_existotal < 0, { 255, 0, 0 }, If( RecNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) ) } } ;
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255, 255, 255 }, {0,0,0} ) } } ;
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.
Re: Forecolor in grid displays the records alternating color
Hi Rathinagiri,
It works ok, but.. can you tell me please why the way I suggested does not work and your example works well, what is the difference?, one way or the other.
Thanks
Best Regards
Javier
Code: Select all
DYNAMICBACKCOLOR { bckColor, bckColor, { || If( g_existotal < 0, { 255, 0, 0 }, If( RecNo() % 2 == 0, { 255,255,255 } , { 244,244,244 } ) ) } } ;
DYNAMICFORECOLOR { bckFore , bckFore , { || If( g_existotal < 0, { 255, 255, 255 }, {0,0,0} ) } } ;Thanks
Best Regards
Javier